Results 1 to 6 of 6

Command Button to add +1 to Textbox;

Threaded View

  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?

    Private Sub CommandButton2_Click()
    Me.TextBox1.Value = Me.TextBox1.Value + 1
    End Sub
    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.

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