+ Reply to Thread
Results 1 to 3 of 3

excel userform spin button changes textbox value to two the first time it is clicked

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Corning, NY
    MS-Off Ver
    Office 365
    Posts
    4

    excel userform spin button changes textbox value to two the first time it is clicked

    I have a userform that contains a textbox/spin button combination.

    I want the user to select a value between 1 and 50.

    I've set the value of the textbox = 0 and SmallChange value of the SpinButton to 1.

    I default the textbox value to 0 to ensure that the user has to set set it to some non-zero value. If they attempt to submit the form with 0 units, it alerts them that the value must be greater than 0 to continue.

    The problem is, when the user clicks on the up spin button the first time, the value of the textbox jumps from 0 to 2 (skips 1). If the user wants to select 1, they have to backtrack and click the down button once.

    After that, the button works exactly as it should incrementing or decrementing by 1 each time either button is pushed.

    What am I missing???

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937

    Re: excel userform spin button changes textbox value to two the first time it is clicked

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to "Post Quick Reply" button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: excel userform spin button changes textbox value to two the first time it is clicked

    Hi there,

    It's difficult to make meaningful suggestions without access to your code, but


    I default the textbox value to 0 to ensure that the user has to set it to some non-zero value

    have you tried setting the default value of your SpinButton to zero also?


    Regards,

    Greg M

+ 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] Link textbox to spin button on userform
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2020, 10:56 AM
  2. Couln't link up with textbox to spin button in userform
    By ajaypal.sp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2016, 08:14 AM
  3. [SOLVED] Enable Disable spin button based on a textbox
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2015, 07:21 AM
  4. Excel spin button on Userform
    By OneSurya in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2013, 02:19 PM
  5. [SOLVED] change range a table appears every time a button within a userform is clicked
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 05:07 PM
  6. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  7. Use the spin button to change value in textbox?
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2010, 12:22 AM

Tags for this Thread

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