Hi guys,
im looking for a macro that can hide/show command buttons in 2007. and how do you find the name of the command button to put into the code? i cant find its variable name anywhere???
Thanks for the help
if you want to hide/show a commandbutton you can try this option:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Not Intersect(Target, Range("d1")) Is Nothing Then CommandButton5.Visible = True 'double click in cell d1 and yr commandbutton appears End If If Not Intersect(Target, Range("d2")) Is Nothing Then CommandButton5.Visible = False ''double click in cell d2 and yr commandbutton disappears End If
Regards, John
To discover the name, you need to click on the Design mode button on the developer tab, then select the button and the name will appear in the Name box.
Good luck.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks