After searching for some code to make a button visible dependent on cell values, I found some code on here that 'almost works'
3 of the 6 buttons on the sheet could be visible at any time, would appreciate any help tidying up this code to allow.
I thank you in advance for reading.
Darren
Code below:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Btn As Excel.Button
Set Btn = ActiveSheet.Buttons("Button 90")
With Target
If .Count = 1 And .Address = "$W$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
Set Btn = ActiveSheet.Buttons("Button 89")
With Target
If .Count = 1 And .Address = "$X$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
Set Btn = ActiveSheet.Buttons("Button 88")
With Target
If .Count = 1 And .Address = "$Y$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
Set Btn = ActiveSheet.Buttons("Button 91")
With Target
If .Count = 1 And .Address = "$L$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
Set Btn = ActiveSheet.Buttons("Button 93")
With Target
If .Count = 1 And .Address = "$J$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
Set Btn = ActiveSheet.Buttons("Button 92")
With Target
If .Count = 1 And .Address = "$K$28" And .Value = "Y" Then
Btn.Visible = True
Else
Btn.Visible = False
End If
End With
End Sub
Bookmarks