picture disappear based on conditional formatting code help?

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
hi,

I have a range of cells which change color based on some vlookup formulas with conditional formatting.

What i need to do is, if any of these cells change to red, then a picture will appear and disappear if the red cells disappears.

my code looks ok in theory to me, but i must be missing something.
any help would be much appreciated.

heres my current code:

Private Sub Worksheet_Change(ByVal Target As Range)
'
'picture appears when red cells are visible
'
If Cells("C4").Interior.ColorIndex = 3 Then
Sheets("Sheet1").Shapes("picture1").Visible = True
Else
Sheets("Sheet1").Shapes("picture1").Visible = False
End If

End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

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