Add the values of a listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ss112358
    New Member
    • Dec 2007
    • 8

    Add the values of a listbox

    Hi all. Lets just say I have a listbox of full of values. Can someone help me write some code to add all the numerical values of the listbox? Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What do you mean by all the numerical values of the listbox .
    What exactly are you trying to do ?

    Comment

    • ss112358
      New Member
      • Dec 2007
      • 8

      #3
      Originally posted by debasisdas
      What do you mean by all the numerical values of the listbox .
      What exactly are you trying to do ?
      Thankyou for your reply. I have a listbox with numerical values that the user enters. I then want to find the total sum of all the values in the listbox.

      Thanks again

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Loop from 0 to (List1.ListCoun t-1) and write the code to add..


        Regards
        Veena

        Comment

        • ss112358
          New Member
          • Dec 2007
          • 8

          #5
          Originally posted by QVeen72
          Hi,

          Loop from 0 to (List1.ListCoun t-1) and write the code to add..


          Regards
          Veena
          Can you please give me an example? I am getting confused.. Thanks

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by ss112358
            Can you please give me an example? I am getting confused.. Thanks
            There is nothing to get confused. Retrive all the values using the listindex peoperty . You need to add the values in a loop. You will not learn anything till you try yourself.

            Kindly post what you have tried so far for further discussion on the topic.

            Comment

            Working...