ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,726
- Office Version
- 2007
- Platform
- Windows
I normally work with userforms so this is different for me.
On my worksheet in cell E3 will either be (1) or (2) brackets are also shown in cell.
Depending which value is in the cell depends which command button i would like to be shown / hidden on the worksheet.
The following code hides command button fine but now i dont see either of them.
I have put the code in the change event.
Im expecting the command buttons to toggle etc but not sure what ive done or where to go from here
I also dont think change event is correct as i need the code to monitor it all the time
On my worksheet in cell E3 will either be (1) or (2) brackets are also shown in cell.
Depending which value is in the cell depends which command button i would like to be shown / hidden on the worksheet.
The following code hides command button fine but now i dont see either of them.
I have put the code in the change event.
Im expecting the command buttons to toggle etc but not sure what ive done or where to go from here
I also dont think change event is correct as i need the code to monitor it all the time
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("A1:A38" & "," & "N4:S32")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
If Range("E3") = (1) Then
SecondMonthsSheet.Visible = False
End If
If Range("E3") = (2) Then
TransferButton.Visible = False
End If
End Sub