+ Reply to Thread
Results 1 to 6 of 6

Command Button to add +1 to Textbox;

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Command Button to add +1 to Textbox;

    Hello - A userform has two controls: textbox1 and command button 2. When the button is clicked +1 is added to textbox 1. Each time the command button is pressed +1 added to textbox1.

    I tried this but it doesn't work. What am I missing?

    Please Login or Register  to view this content.
    Conversely, another commandbutton3 when click will -1 the same textbox1. Will the code be the same as the above except for a -1? If I don't want any negative integers and only show zero, how is this coded?

    Thanks,
    Gal403

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 12-06-2013 at 03:39 AM.

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Command Button to add +1 to Textbox;

    try something like this
    Please Login or Register  to view this content.
    please change your code - select the code & then select # on the tool bar.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Command Button to add +1 to Textbox;

    try this code

    Please Login or Register  to view this content.
    click the star if it solves your problem

  4. #4
    Registered User
    Join Date
    12-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Command Button to add +1 to Textbox;

    Thanks Sean. I must be missing something because I'm getting a mismatch error. Here is my code.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Command Button to add +1 to Textbox;

    Thank you Dwint!! My problem solved. Cheers

  6. #6
    Registered User
    Join Date
    12-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Command Button to add +1 to Textbox;

    Thank you Sean Thomas!!. It worked! Cheers.

+ 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. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  2. Disabling Command button on textbox value being true
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2011, 02:49 AM
  3. for loop with textbox and command button
    By st0kvis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2011, 04:33 AM
  4. Display selected file path(command button) in textbox
    By sameerk0286 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2010, 05:40 AM
  5. Adding a textbox via command button
    By NewExcelUser in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2006, 12:49 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