Ancient Wolf
Board Regular
- Joined
- Mar 17, 2009
- Messages
- 89
Hello again Mr. Excel.
This time, I am looking for a way to hide specific objects created with the insert shapes tool when a specific client is selected from a DV drop down list.
The clients would be something like Sam's Club, Wal-Mart New Pilot, and Service Valet.
The objects that I need to have hide or unhide are labeled by text, such as "TV", "Audio, "Camera"
I would need the object labeled "Camera" to be hidden if Wal-Mart was selected, but have all 3 objects visible when Sam's Club was selected. For Service Valet, "Audio" and "Camera" would need to be hidden. Also, could all the objects be hidden if no clients are selected?
Can the coding listed below incorporate the needed VBA?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("25:32").Hidden = Target.Value <> "Sam's Club" And Target.Value <> "Walmart New Pilot"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("12:14").Hidden = Target.Value <> "Service Valet"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("121:121").Hidden = Target.Value <> "Sam's Club"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub
This time, I am looking for a way to hide specific objects created with the insert shapes tool when a specific client is selected from a DV drop down list.
The clients would be something like Sam's Club, Wal-Mart New Pilot, and Service Valet.
The objects that I need to have hide or unhide are labeled by text, such as "TV", "Audio, "Camera"
I would need the object labeled "Camera" to be hidden if Wal-Mart was selected, but have all 3 objects visible when Sam's Club was selected. For Service Valet, "Audio" and "Camera" would need to be hidden. Also, could all the objects be hidden if no clients are selected?
Can the coding listed below incorporate the needed VBA?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("25:32").Hidden = Target.Value <> "Sam's Club" And Target.Value <> "Walmart New Pilot"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("12:14").Hidden = Target.Value <> "Service Valet"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
If Target.Address(False, False) = "B3" Then
ActiveSheet.Unprotect
Rows("121:121").Hidden = Target.Value <> "Sam's Club"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub
Last edited: