Need to hide objects when clients are selected from a drop down list.

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
 
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Can you put code to make the various objects Visible property to TRUE/FALSE inside the code you already have?
 
Upvote 0
Thank you for the response, GlennUK. Someone provided me the coding that I needed to make the objects that I wanted hide and unhide. Everything is working now. Thank you for the suggestion.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top