+ Reply to Thread
Results 1 to 11 of 11

howto: sum textbox values and show result in textbox9

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    howto: sum textbox values and show result in textbox9

    howto: combobox.value (for example "3") multiply with 46,5 (example) and show result in textbox (VBA) (please look at picture)

    the combox3 is just for the IC2 traintype but as long as i get things working for only one i only have to repeat for the other traintypes.

    i want to multiply a number of trainsets (combobox3.value) with their actual length and show the result in a textbox or what i need to show it in,, i have several traintypes.

    in another task i then need to add all the lengths-boxes for whatever traintypes i have chossen and add all those results and show them in another box - a all-in-all length box.

    how do i begin this?

    /Jan
    Attached Images Attached Images
    Last edited by Lkivagten; 08-08-2012 at 04:01 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: howto: combobox.value (for example "3") multiply with 46,5 and show result in textbox

    I believe you'll need to begin by creating a userform in Visual Basic, once you have got your basic design set up let us know where the information is being pulled from and how you want it to work. Also, please attach a sample workbook instead of a screen print.

    Thanks!

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: howto: combobox.value (for example "3") multiply with 46,5 and show result in textbox

    Hi Rvasquez

    Thanks for your reply.. i have tried to mess around with it and can get some of the way .. close but no cigar.
    I have coded this:
    Please Login or Register  to view this content.
    and my purpose is to get the trainlength for traintypes chosen (IC2,IC3,IC4 and so on) added and snown in the all-in-all meters box (textbox9) .
    'i need to convert values from text format to numbers and then show the result from adding all choosen traintypes in textbox9 but something goes wrong. I can show the result from IC2 in textbox9 but thats it.

    Where am i doing wrong ?
    Attached Files Attached Files
    Last edited by Lkivagten; 08-08-2012 at 01:13 PM.

  4. #4
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: howto: combobox.value (for example "3") multiply with 46,5 and show result in textbox

    hi again ..

    this is my newest code and maybe this is more correct ?.. i dont get errors but i dont get any numbers in textbox9 either..

    Do i need to change back from numberformat to textformat? - if so ..how ?

    Or am i completely wrong here ?

    Please Login or Register  to view this content.
    Anybody ?

    /Jan

    ---------- Post added at 07:41 PM ---------- Previous post was at 07:36 PM ----------

    tried this also.. no change.

    no errors but no result in textbox9 :\

    Please Login or Register  to view this content.
    Suggestions?

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: howto: combobox.value (for example "3") multiply with 46,5 and show result in textbox

    Hello there,

    I'm sorry it's a little hard to understand what you are trying to do. What determines what range of cells to total in Textbox9?

  6. #6
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: howto: combobox.value (for example "3") multiply with 46,5 and show result in textbox

    hi

    Im trying to sum the numbers within the textboxes : IC2,IC3,IC4,ER4 and so on and show the result in textbox9. The IC2,IC3,IC4,ER4 and so on textboxes are populated by what is choosen in the belonging comboboxes for IC2,IC3,IC4,ER4 and so on.

    Please look at spid.xls which is within another reply .. look up )

    Thanks

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: howto: sum textbox values and show result in textbox9

    Hello there,

    Attached is your original workbook updated to include a macro appended to the end of the SPID userform's code that sums the values of the textboxes with the Multipage2 Page1 on the form. On each of the textboxes on change event I called this macro so that any time the text box are updated the value in textbox9 is updated as well.

    Let me know if you have any questions.

    Thanks!
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: howto: sum textbox values and show result in textbox9

    Thank you rvasquez

    That did the trick

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: howto: sum textbox values and show result in textbox9

    @ Lkivagten

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  10. #10
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: howto: sum textbox values and show result in textbox9

    Hi cutter and rvasquez

    As cutter pointed out i forgot to mark post as solved.
    Sorry about that,, i simply forgot in the heat of coding my newly received working answer.

    Thanks again to rvasquez for helping me out and to cutter for marking thread as solved.

    /Jan

  11. #11
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: howto: sum textbox values and show result in textbox9

    No problem!

+ 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