Hiding multiple pictures

diatex

Board Regular
Joined
Jan 16, 2004
Messages
96
The code below was supplied by Tommygun in a previous post and enables a picture to be hidden by the use of a toggle button, i have been playing about with it trying to hide multiple pictures (2 or 3) but without any success. Would each picture require its own button?? any pointers most welcome.
Sub HidePicture()
Dim v As Boolean
v = ActiveSheet.Shapes("Object 1").Visible
ActiveSheet.Shapes("Object 1").Visible = Not v
End Sub

Thanks Diatex
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this:

Code:
Sub HidePicture() 
Dim v As Boolean 
    v = ActiveSheet.Shapes("Object 1").Visible 
    ActiveSheet.Shapes("Object 1").Visible = Not v 
    ActiveSheet.Shapes("Object 2").Visible = Not v 
    ActiveSheet.Shapes("Object 3").Visible = Not v 
End Sub

Assuming those are the objects you want to hide, modify as needed.
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,373
Members
448,888
Latest member
Arle8907

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