Insert .jpg based on Cell value in Excel?

SinnaminGrrl

Board Regular
Joined
Feb 21, 2006
Messages
65
Hi,

I have some code that changes the colour of a cell based on the value of that cell, not sure how useful this is as I could just simply use conditional formatting, but I found this code here as a starting point to what I was trying to accomplish.

I have a pivot table that is constantly changing values, the column is a result of a number of days...not really relevant.... however If the cell contains a value of greater then 7 I want to insert a .JPG of a lil stop sign, if less then 7 then a little green go sign will be inserted, can someone help? This is what I have so far..just changes cell color.

Sub DoOnSelection()
Dim oCell As Range
For Each oCell In Selection
If oCell.Value > 7 Then
oCell.Interior.ColorIndex = 3
End If

Next
End Sub
 
I know this is an old thread, but maybe someone could help me out. I'm using conditional formatting in Excel 2007 to have either an empty circle, a half full circle or a full circle displayed based on the value entered in that cell (0=empty, 2=half full, 3=full). We would like to have 1 show an empty circle with a line through it. In Excel, this value would show a quarter of the circle filled, but my clients are looking for just a line through it which is easier to hand write in and to view. There are about 20 rows and 25-30 columns in this matrix.

I've already created a small drawing object in Excel of the circle with a line through it. Is there any way to have this object appear over the conditional formatting automatically? (I'm okay with hitting a refresh or run button each time the matrix is updated).

Thanks for any help available.


PS- I tried to download the sample workbook but the link is dead :(
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,982
Messages
6,175,776
Members
452,668
Latest member
mrider123

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