View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Hiding A Sheet Command Button With VBA

Worksheets("sheet1").CommandButton1.Visible = False

--
Regards,
Tom Ogilvy

"Minitman" wrote in message
...
Greetings,

I have a Command Button on a worksheet than under some conditions
needs to be hidden. I am trying to hide it from a UserForm. I have
tried:

CommandButton1.Visible = False

In the code to start the next procedure, I get this message in a
"Microsoft Visual Basic" message box:

Compile Error:
Variable not defined

Any suggestions?

TIA

-Minitman