J
Johanna Gronlund
Hello,
I have been trying to write a macro that would hide a button based on a cell
value (cell N20). Somehow, it doesn't work. If N20=1, the button should be
visible. If not, then it should be hidden.
The button is called Button 4388 and the sheet is called Results.
This is what I have come up with so far but as I said it doesn't work
(please don't laught, I'm a beginner!):
Sub HideButton()
Dim myButton As Button
With ActiveSheet
Set myButton = .Buttons("Button 4388")
If Range("N20").Value = "1" Then
..Visible = True
Else
..Visible = False
End If
End With
End Sub
I have been trying to write a macro that would hide a button based on a cell
value (cell N20). Somehow, it doesn't work. If N20=1, the button should be
visible. If not, then it should be hidden.
The button is called Button 4388 and the sheet is called Results.
This is what I have come up with so far but as I said it doesn't work
(please don't laught, I'm a beginner!):
Sub HideButton()
Dim myButton As Button
With ActiveSheet
Set myButton = .Buttons("Button 4388")
If Range("N20").Value = "1" Then
..Visible = True
Else
..Visible = False
End If
End With
End Sub