Hide a button

  • Thread starter Thread starter Paul Watkins
  • Start date Start date
P

Paul Watkins

Hi
I am trying to hide a button on a sheet until another cell equals a certain
value
I've tried this code, but without sucess
The Button is 'Button1'


Sub TEST()
If Range("C2").Value = 2 Then
Button1.Visible = xlButtonHidden
Else
End If
End Sub



Thanks in advance

Paul
 
What's this new constant that you have found, xlButtonHidden?

Sub TEST()

If Range("C2").Value = 2 Then
Activesheet.Button1.Visible = False
End If

End Sub

if its a control button, or

Sub TEST()

If Range("C2").Value = 2 Then
Activesheet.Shapes("Button1").Visible = False
End If

End Sub

if its a forms button.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob it works a treat.

I couldn't remeber the correct syntax, it was worth a try, wasn't it :)

Paul
 
There is a constant called xlHidden, and another called xlVeryHidden.
xlButtonHidden sounds god, but not necessary<vbg>
 
Back
Top