+ Reply to Thread
Results 1 to 2 of 2

Min and Max limits on Spin Button (userform)

  1. #1
    Registered User
    Join Date
    11-19-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    43

    Min and Max limits on Spin Button (userform)

    Hi all.

    Firstly please pardon me for my lack of experience with VBA. I am trying to place a minimum and a maximum limit on a spin button (which is on a Userform with a textbox), with the Minimum limit being 0% and Maximum being 100%.
    The Spinner controls a named range cell (called percentage_input) and the textbox on my userform is linked to this named range cell.

    Please find attached an example workbook to show you the layout.

    Do i need to put the limit on the actual worksheet cell? or do i need to write some code on the spinner up/down event (e.g. spinButton1.Min = 0) or something like this?

    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,704

    Re: Min and Max limits on Spin Button (userform)

    You have already set the correct limits in the attributes of the spin button in its Properties list. However, I can't figure out what you want to do when the spin button is clicked. Your code does not actually refer to the value of the spin button anywhere. Instead you are adjusting the value of a cell by adding or subtracting 0.05 (5%) when the spin button is clicked up or down, respectively.

    I would suggest that you make the attribute SmallChange = to 5, and then change your code to:

    Please Login or Register  to view this content.
    Now when you click the button, the cell will have the same value as the spin button, converted to a percentage.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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] Help with Spin Button. Set Spin button starting value based on a text box value
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2014, 10:05 AM
  2. [SOLVED] Userform spin button different way to display number of records
    By guitarsweety in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 08:09 AM
  3. Excel spin button on Userform
    By OneSurya in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2013, 02:19 PM
  4. Replies: 2
    Last Post: 03-12-2008, 06:52 PM
  5. Spin Button:spin cells A7
    By ice in forum Excel General
    Replies: 1
    Last Post: 03-16-2007, 02:23 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