+ Reply to Thread
Results 1 to 5 of 5

Disable/enable spin button, hide and unhide button based on a cell value

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Disable/enable spin button, hide and unhide button based on a cell value

    Hi,
    I make two examples for help.

    1. Disable and enable form control spinner button based on a cell value to lock
    spin button and it's link cell.

    2. Hide and unhide form control spinner button based on a cell value.

    I would like the change is real time without hitting a return key.

    Thank you
    Last edited by Rocky2013; 05-12-2022 at 02:10 PM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Disable/enable spin button, hide and unhide button based on a cell value

    Try this:

    Please Login or Register  to view this content.
    You can't just "lock E16". You could lock the cell and protect the sheet, but it would need just as much code. However, by undoing the change it is basically the same as locking it if B16 = 2
    Last edited by Arkadi; 05-12-2022 at 02:54 PM. Reason: Forgot the E16 condition
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Disable/enable spin button, hide and unhide button based on a cell value

    Hello,
    It works, but I have to press a return key. the value in B16, is not a hand type number but rather come from the result of another cell. This code is good. I am creating another example similar to this, should I create a new thread or upload the file?


    Thanks

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Disable/enable spin button, hide and unhide button based on a cell value

    Hi Rocky2013,

    Yes you do have to press a return key, because until you do, the cell hasn't changed. Also, if the change is the result of a formula, it won't trigger the macro, but... you COULD make a change event for the source cell instead. Since it is a continuation of the same issue/question, there is no need to start a new thread for this, just go ahead and upload a file.

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Disable/enable spin button, hide and unhide button based on a cell value

    hi,
    thank you for quick reply. Attach is a version 2 of example file, it looks similar to previous but not same.
    Last edited by Rocky2013; 05-13-2022 at 05:00 PM.

+ 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] Disable/Enable Button based on Cell Value
    By mlo_omg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2021, 11:51 AM
  2. [SOLVED] VBA Code to hide and unhide a button based on a specific cell value
    By UWBadger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-06-2019, 07:02 PM
  3. Hide/Unhide sheets using a spin button
    By rumilinus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2019, 10:29 PM
  4. VBA to hide or disable a form control button based on cell value
    By npsnps in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-11-2017, 06:40 AM
  5. [SOLVED] Hide/Unhide row based on cell value with a check box button
    By infratunes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2016, 10:09 PM
  6. [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
  7. [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

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