Conditional Display of pictures ?

ckelly

New Member
Joined
Mar 10, 2005
Messages
2
Braintrust...

I need to have various pictures show or not show in a spreadsheet depending on whether a condition is satisfied. I have used conditional formatting extensively for text, but it's greyed out when I select a picture.

Is there anything with add-ons or VBA that could help me ? Any suggestions ? Grateful thanks.

Chuck
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi Chuck,

Yes, a bit if VBA can do this. Here's an example:

Private Sub Worksheet_Calculate()
Pictures.Visible = False
If [b4] > 4 Then
Pictures(1).Visible = True
ElseIf [b4] > 2 Then
Pictures(2).Visible = True
End If
End Sub

This code will make the first picture visible if the value of cell B4 > 4, and the second picture visible if 4 > B4 > 2. This is worksheet event code, so must go in the worksheet event code module. To do this, right-click on the worksheet's tab, select View Code and paste this code in the Code module.

You can also refer to the pictures by name rather than index number, e.g., Pictures("Locust Tree").Visible = True. You can name a picture as you would a cell by selecting the picture and typing the name into the Name box above cell A1.

Damon
 
Upvote 0

Forum statistics

Threads
1,215,561
Messages
6,125,533
Members
449,236
Latest member
Afua

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