Results 1 to 5 of 5

Thread: Sums

  1. #1
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Sums

    Two numbers are stored in cells in a spreadsheet, two ComboBoxes each address one of those cells and retrieve it's number. I now want to add the numbers that are now located in the ComboBoxes and display the result in say, a third ComboBox. How do I do this? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Sums

    It is difficult to envisage exactly what you need, but why not have a third cell summing the contents of the other two and pointing a combobox at that cell. What function do the comboboxes play in the worksheet ? Are you sure comboboxes are what you need for this ?

    Andrew C

  3. #3
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Sums

    Thanks for your comment. The Form I've created has several
    comboboxes that point to different ranges on a worksheet. From the Form, each combobox has a variety of selections [numeric]. After each CB has the desired selection, another CB sums all the selections. I have overcome my problem using something similar to your suggestion, but still wonder if it's possible to numerically sum CB's value in place of concatenating them.
    I've tried Converting the values and adding,
    Me.Combobox1= Format(Me.Combobox2)+ Format(Me.Combobox3)
    and inplace of 2+2=4 the result is 22.

    John

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Sums

    Have you tried using the Val() function as follows :

    = Val(Me.ComboBox1) + Val(Me.ComboBox2)

    Unless you want apply specific formatting there is no need for Format, however if you want it the following should example should work :

    = Format(Val(Me.ComboBox1) + Val(Me.ComboBox2),"#'##0.00")

    Hope that works for you,

    Andrew

  5. #5
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Sums

    Thanks Andrew, = Val(Me.ComboBox1) + Val(Me.ComboBox2) is just what I needed.

    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •