+ Reply to Thread
Results 1 to 7 of 7

help needed with excel programming!!!

  1. #1
    gem.g
    Guest

    help needed with excel programming!!!

    i have two listboxes containing values. i need to multiply these two values
    and display the answer in a text box. but am unsure on how to do so!
    can anyone help please?
    thanks

  2. #2
    Bob Phillips
    Guest

    Re: help needed with excel programming!!!

    Textbox1.Text = Listbox1.Value * Listbox2.Value

    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "gem.g" <u23227@uwe> wrote in message news:620e45f13d9b3@uwe...
    > i have two listboxes containing values. i need to multiply these two

    values
    > and display the answer in a text box. but am unsure on how to do so!
    > can anyone help please?
    > thanks




  3. #3
    Giles B
    Guest

    RE: help needed with excel programming!!!

    put the following code into (say) the change event for listbox1 and listbox2
    - then the textbox will be updated whenever either value changes.

    if listbox1.value <> "" and listbox2.value <> "" then
    textbox1.value = listbox1.value * listbox2.value
    end

    or - simplified

    textbox1 = listbox1 * listbox2

    "gem.g" wrote:

    > i have two listboxes containing values. i need to multiply these two values
    > and display the answer in a text box. but am unsure on how to do so!
    > can anyone help please?
    > thanks
    >


  4. #4
    gem.g
    Guest

    RE: help needed with excel programming!!!

    thanks for the help, it worked!
    another problem i have is..... i have allowed the user to select from a combo
    box which then displays a price into a text box. (that all works fine!!) BUT..
    ... how do i multiply this price by a number which is in a list box and then
    display the answer into another list box???
    hope you can help!
    thanks



    Giles B wrote:
    >put the following code into (say) the change event for listbox1 and listbox2
    >- then the textbox will be updated whenever either value changes.
    >
    >if listbox1.value <> "" and listbox2.value <> "" then
    >textbox1.value = listbox1.value * listbox2.value
    >end
    >
    >or - simplified
    >
    >textbox1 = listbox1 * listbox2
    >
    >> i have two listboxes containing values. i need to multiply these two values
    >> and display the answer in a text box. but am unsure on how to do so!
    >> can anyone help please?
    >> thanks


  5. #5
    gem.g
    Guest

    RE: help needed with excel programming!!!

    thanks for the help, it worked!
    another problem i have is..... i have allowed the user to select from a combo
    box which then displays a price into a text box. (that all works fine!!) BUT..
    ... how do i multiply this price by a number which is in a list box and then
    display the answer into another list box???
    hope you can help!
    thanks



    Giles B wrote:
    >put the following code into (say) the change event for listbox1 and listbox2
    >- then the textbox will be updated whenever either value changes.
    >
    >if listbox1.value <> "" and listbox2.value <> "" then
    >textbox1.value = listbox1.value * listbox2.value
    >end
    >
    >or - simplified
    >
    >textbox1 = listbox1 * listbox2
    >
    >> i have two listboxes containing values. i need to multiply these two values
    >> and display the answer in a text box. but am unsure on how to do so!
    >> can anyone help please?
    >> thanks


  6. #6
    Giles B
    Guest

    RE: help needed with excel programming!!!

    Gem,

    Very similar to before:

    In the change event for the two "input" boxes (the ones that are
    selectable/changeable - e.g. the combobox and the price listbox) put the
    following:

    if listbox1.value <> "" and textbox1.value <> "" then _
    listbox2.value = listbox1.value * textbox1.value

    where:

    listbox1 is the price listbox
    listbox2 is the listbox where you want the answer to appear
    textbox1 is the text box where the price exists

    Giles


    "gem.g" wrote:

    > thanks for the help, it worked!
    > another problem i have is..... i have allowed the user to select from a combo
    > box which then displays a price into a text box. (that all works fine!!) BUT..
    > ... how do i multiply this price by a number which is in a list box and then
    > display the answer into another list box???
    > hope you can help!
    > thanks
    >
    >
    >
    > Giles B wrote:
    > >put the following code into (say) the change event for listbox1 and listbox2
    > >- then the textbox will be updated whenever either value changes.
    > >
    > >if listbox1.value <> "" and listbox2.value <> "" then
    > >textbox1.value = listbox1.value * listbox2.value
    > >end
    > >
    > >or - simplified
    > >
    > >textbox1 = listbox1 * listbox2
    > >
    > >> i have two listboxes containing values. i need to multiply these two values
    > >> and display the answer in a text box. but am unsure on how to do so!
    > >> can anyone help please?
    > >> thanks

    >


  7. #7
    gem.g
    Guest

    RE: help needed with excel programming!!!

    thanks for the help but it didnt work!!!
    thanks again

    Giles B wrote:
    >Gem,
    >
    >Very similar to before:
    >
    >In the change event for the two "input" boxes (the ones that are
    >selectable/changeable - e.g. the combobox and the price listbox) put the
    >following:
    >
    >if listbox1.value <> "" and textbox1.value <> "" then _
    >listbox2.value = listbox1.value * textbox1.value
    >
    >where:
    >
    >listbox1 is the price listbox
    >listbox2 is the listbox where you want the answer to appear
    >textbox1 is the text box where the price exists
    >
    >Giles
    >
    >> thanks for the help, it worked!
    >> another problem i have is..... i have allowed the user to select from a combo

    >[quoted text clipped - 19 lines]
    >> >> can anyone help please?
    >> >> thanks


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1