+ Reply to Thread
Results 1 to 5 of 5

[SOLVED] hide/disable button based on cell value

  1. #1
    Registered User
    Join Date
    03-30-2016
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    93

    [SOLVED] hide/disable button based on cell value

    I have a sheet with 4 buttons, start, stop, reset and view leaderboard, these are command buttons 1 to 4.

    The below code is supposed to make the command button 2 only visible if the entry in cells L14 and L17 is P. (Windings2 shows a 'tick' for an uppercase P).

    However when I press on the 'Start@ button I get an error.

    Run-time error'1004':
    Method 'Range' of objet '_Worksheet' failed

    The code is.

    Please Login or Register  to view this content.
    The codes for the buttons are as follows

    Please Login or Register  to view this content.
    Any help appreciated.
    Last edited by dori2o; 11-10-2017 at 04:07 PM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: hide/disable button based on cell value

    Try this:
    Please Login or Register  to view this content.
    ps Forum Rules require you to place code tags around your code so it displays correctly across different platforms. Just click Edit Post, select your code text, and click the # icon on the Editing toolbar. Thanks!
    Last edited by leelnich; 11-08-2017 at 10:02 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: hide/disable button based on cell value

    Did that work? If yes, please go to Thread Tools (up top) and mark your thread as SOLVED. Thanks! - Lee

  4. #4
    Registered User
    Join Date
    03-30-2016
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    93

    Re: hide/disable button based on cell value

    Thanks, the code was great. Just had to change from If/Or to If/And and it's great.

    Unfortunately now I have another issue.

    This is the code for the start button and the timer.

    Please Login or Register  to view this content.
    Is there any way to amend the code so that the timer continues to run whilst making changes to other cells in the worksheet?

  5. #5
    Registered User
    Join Date
    03-30-2016
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    93

    Re: hide/disable button based on cell value / keep timer running and update excel at same

    So by messing about I've noticed that if I'm entering text into a text box the timer continues to run.
    is it possible to have a situation where a formula in cell L14 looks for words in a text box that match a list of keywords in cells S1:S4, and returns a letter "P" if the words are there, or a "O" if not?


    Alternatively is there a way of changing the command button 1 code, or adding/changing any code to ensure that the timer does not stop when I edit cells in the worksheet?
    Last edited by dori2o; 11-09-2017 at 07:08 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. 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
  2. [SOLVED] Disable or hide a recorded macro button when clicked if the worksheet is protected
    By sai19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2014, 12:14 PM
  3. Disable or Hide Command Button for certain users
    By cvishu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2014, 12:44 PM
  4. [SOLVED] Use API to disable or hide the Close Button or Caption Bar on UserForms
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-25-2014, 09:33 PM
  5. How to hide command button based on another cell?
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2014, 09:28 AM
  6. Hide form button or rectangle based on cell value
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-14-2009, 10:58 AM
  7. Hide or disable the 'Close' button
    By 5631 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2008, 12:36 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