Phelony
04-23-2009, 08:20 AM
:help Once more I knock on your door seeking VBA based wisdom! :hi:
I've got a drop down menu that is supposed to trigger sets of rows to hide when different selections are made. :thumb
However, after several attempts, I've made it either get rid of all the rows, not give them back or just stare blankly back at me hoping I'll go away and leave it alone. :banghead:
From the below, when I select "client" it should hide rows 3,5,7 and when I select "trust" rows 3,5,7 should come back and rows 2,4,6 should hide.
There will be instances when the same row is required for multiple selections in the full version, but for now, could someone please just let me know how I've screwed this up :eek: and how I can fix it? :cloud9:
Private Sub Worksheet_Change(ByVal Target As range)
If Target.Address = "$A$1" Then
If Target.Value = Client Then
Rows(3).EntireRow.Hidden = True
Rows(5).EntireRow.Hidden = True
Rows(7).EntireRow.Hidden = True
Else
Rows(2).EntireRow.Hidden = False
Rows(4).EntireRow.Hidden = False
Rows(6).EntireRow.Hidden = False
End If
If Target.Value = Trust Then
Rows(2).EntireRow.Hidden = True
Rows(4).EntireRow.Hidden = True
Rows(6).EntireRow.Hidden = True
Else
Rows(3).EntireRow.Hidden = False
Rows(5).EntireRow.Hidden = False
Rows(7).EntireRow.Hidden = False
End If
End If
End Sub
Thanks
Phel x :rofl:
I've got a drop down menu that is supposed to trigger sets of rows to hide when different selections are made. :thumb
However, after several attempts, I've made it either get rid of all the rows, not give them back or just stare blankly back at me hoping I'll go away and leave it alone. :banghead:
From the below, when I select "client" it should hide rows 3,5,7 and when I select "trust" rows 3,5,7 should come back and rows 2,4,6 should hide.
There will be instances when the same row is required for multiple selections in the full version, but for now, could someone please just let me know how I've screwed this up :eek: and how I can fix it? :cloud9:
Private Sub Worksheet_Change(ByVal Target As range)
If Target.Address = "$A$1" Then
If Target.Value = Client Then
Rows(3).EntireRow.Hidden = True
Rows(5).EntireRow.Hidden = True
Rows(7).EntireRow.Hidden = True
Else
Rows(2).EntireRow.Hidden = False
Rows(4).EntireRow.Hidden = False
Rows(6).EntireRow.Hidden = False
End If
If Target.Value = Trust Then
Rows(2).EntireRow.Hidden = True
Rows(4).EntireRow.Hidden = True
Rows(6).EntireRow.Hidden = True
Else
Rows(3).EntireRow.Hidden = False
Rows(5).EntireRow.Hidden = False
Rows(7).EntireRow.Hidden = False
End If
End If
End Sub
Thanks
Phel x :rofl: