+ Reply to Thread
Results 1 to 5 of 5

Sum the contents of multiple Textboxes in VBA

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    54

    Unhappy Sum the contents of multiple Textboxes in VBA

    Hello,

    First off, I'm fairly new to actually using VBA so this might be a totally stupid and easy question for the more experienced user, but you got to start somewhere. I'm building a userform to allow people to enter information and automatically populate an excel document. I've been getting along with it pretty well and have learnt alot, I can get the information entered to populate on the form, automatically enter the user's name that has opened the form, added some como boxes etc with dropdowns but I just cannot for the life of me figure out how to get excel to do this....

    I have a number of textboxes, named textbox1, textbox2 etc. I would like people to enter numbers etc 2,4,4 and for a running total to appear in textboxt4 for example. I've looked online and have seen various solutions but the classic copy and paste, look at the code and figure out what's going on has left me very confused. I cannot believe its that hard to do via VBA.

    If anyone can give me a heads up to what the code should look like that would be gratefully appreciated. Please don't make me feel too stupid. I bet when its so obvious!!

    Daniel

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Sum the contents of multiple Textboxes in VBA

    Try this:

    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum the contents of multiple Textboxes in VBA

    Place the following code on Form Module. Right click on Form on Project Window --> View Code and paste the following code into the code window.
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    09-07-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Sum the contents of multiple Textboxes in VBA

    Thanks, works like a dream.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum the contents of multiple Textboxes in VBA

    You're welcome and thanks for the feedback as well.

    If that takes care of your original question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Filtering contents of a group of textboxes
    By TheScott in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-19-2015, 02:02 PM
  2. Replies: 0
    Last Post: 02-04-2015, 03:46 PM
  3. Replies: 6
    Last Post: 12-07-2012, 05:38 PM
  4. Disabling multiple textboxes
    By austin350s10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2011, 03:59 PM
  5. Reading Word TextBoxes and Transferring Contents to Excel
    By yl358 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2006, 07:04 PM

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