andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
I am trying to make certain objects hide automatically based on the number typed into a cell. I thought I was doing okay, but the second part of my code doesn't seem to be functioning.
I'm hoping this is just something pretty simple that I am not doing correctly.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A12" Then
If Len(Target.Value) = 1 Then
ActiveSheet.Shapes("G_1").Visible = True
ActiveSheet.Shapes("G_2").Visible = False
ActiveSheet.Shapes("G_3").Visible = False
ActiveSheet.Shapes("G_4").Visible = False
End If
End If
If Target.Address(False, False) = "A12" Then
If Len(Target.Value) = 2 Then
ActiveSheet.Shapes("G_1").Visible = False
ActiveSheet.Shapes("G_2").Visible = True
ActiveSheet.Shapes("G_3").Visible = False
ActiveSheet.Shapes("G_4").Visible = False
End If
End If
End Sub
I'm hoping this is just something pretty simple that I am not doing correctly.