Hiding/Revealing Command Buttons

richh

Board Regular
Joined
Jun 24, 2007
Messages
245
Office Version
  1. 365
  2. 2016
Howdy folks!

I'm running Excel 2010

I have a worksheet ("Interface") on which are several controls. One unlocks the workbook and reveals several hidden sheets ("wbUnlock"). One locks the workbook and hides the sheets ("wbLock"). The other buttons allow users to view and retrieve data without being able to manipulate the source ("empLookup"; ""genReports"). I would like to a way to hide the buttons when wbLock is clicked and reveal them once wbUnlock is clicked.

I've tried numerous ways to get this to work, but I keep getting errors. The one I thought would work is...

Sheets("Interface").empLookup.Visible = True/False (depending on button clicked ) | Error "Object doesn't support this property or method"

Is there another way I can hide/reveal these buttons?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Depends on whether you are using forms control buttons or active-x control buttons. See below for each type.
Code:
Sub test()
ActiveSheet.Shapes("Button 1").Visible = False  'this will hide a forms control button named "Button 1"
ActiveSheet.CommandButton1.Visible = False      'this will hide an active-x control button named "CommandButton1"
End Sub
 
Upvote 0
Solution
Thank you JoeMo! I was using the Syntax of an Active-X Control for a forms control button. Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top