+ Reply to Thread
Results 1 to 5 of 5

Do an addition sum to a textbox on a userform VBA

  1. #1
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Do an addition sum to a textbox on a userform VBA

    Hi all,

    I don't know if this will make sense, but here goes. I currently have a userform, which has submits to a spreadsheet via a command button. Basically I am doing data entry and then submitting it - I tend to submit several data inputs at the same time. I have a textbox on the userform with the number 1 in it.

    What I would like to do is that each time you press the submit button, it adds an additional 1 to the textbox mentioned above, so when you go to submit your next one it will say 2 and then when you submit again it will say 3. This will keep going everytime I submit until I close the userform down and have finished adding to the spreadsheet for that round of data entry. At which point when I open the userform up again, the textbox will revert back to having a the number 1 in it.

    I hope this makes sense. Any help would be appreciated. I've tried googiling it and working it out myself without sucess.

    Thanks all.

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Do an addition sum to a textbox on a userform VBA

    Make a Public Variable outside the Sub and add +1 to it everytime you click the "Submit" button

    Something like:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Do an addition sum to a textbox on a userform VBA

    file attached with text box and command button
    Attached Files Attached Files
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

  4. #4
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Re: Do an addition sum to a textbox on a userform VBA

    Thank you both for the quick response.

    I'm really sorry, I wanted to add a reputation for both of you but it only lets me add per post.

  5. #5
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Do an addition sum to a textbox on a userform VBA

    Thats okay! Glad to help

    Have a nice day

+ 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. Display Full Text within Textbox (On A UserForm) when you hover over the textbox
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-20-2015, 09:01 AM
  2. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  3. Replies: 23
    Last Post: 07-12-2014, 07:09 PM
  4. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  5. Userform Textbox updating a another userform textbox (im stuck!!)
    By wapwap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-31-2011, 02:56 PM
  6. Userform: Pass textbox values to another textbox on button press
    By adjustermn in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2010, 11:19 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