View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MarcoR MarcoR is offline
external usenet poster
 
Posts: 5
Default Hide command button

Cory,

Thank you so much.
It worked!

Marco.

"Cory" wrote:

Marco,

I'm assuming that your condition cell (B6) and your command button are on
the same worksheet.

If Range("B6") = "A" Then
CommandButton1.Visible = True
ElseIf Range("B6") = "B" Then
CommandButton1.Visible = False
End If

Replace "CommandButton1" with whatever the name of your print button is. How
the value in B6 is changed will effect where you put that code. For example,
if B6 is modified from another worksheet (via a link) you could put that code
in the Worksheet_Activate section of the worksheet containing the command
button.

"MarcoR" wrote:

I have a command button to print a hidden worksheet.
I want to be able to hide the button based on a condition of a cell.
For example, if cell B6 = A, button is hidden, but if cell B6=B, button is
visible and active for print.
I saw a similar post on this but I could not figure out the code for my
application.
Please help.