Returning a Garphic when certain criteria are met?

adamsmith

New Member
Joined
Mar 20, 2002
Messages
1
I am trying to get a graphic (i.e. red circle, yellow circle, green circle etc..) to appear when the output from a calculation is within a certain parameter i.e. red circle if between 0% and 25%. I'm happy with returning messages but not graphics.

Can anyone help?

Cheers
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Adam,

just my 2 penneth-worth seeing as nobody's replied yet......

could you return a lowercase "o" or an uppercase "O" when the condition(s) is/are met ?

you said you're happy with returning comments so this should be quite easy

then just format the font colour as green red or blue using conditional format

if you need more than 3 colours, there are loads of VBA solutions to >3 colours via conditional formatting already on this board.... have a quick search on "conditional formatting"

if nothing else, at least this post will flag you back to the top of the board and hopefully someone will see it who knows how to write code for conditional graphics
 
Upvote 0
Hi
This assumes you have a shape called Oval 1
drawn on your sheet.
Anyway this should get your foot in the door to doing what you are needing to do.

If value entered in cell A2 is less than 25%
will change the cirle to red
Between 26-50% will make it yellow...

Have Fun!
This message was edited by TsTom on 2002-03-23 16:40
 
Upvote 0
You might need this...

Private Sub Worksheet_Change(ByVal Target As Range)

if target.row<> 2 or target.column<> 1 then exit sub

Select Case Target.Value 'where target cell stores the result of the equation
Case Is< 0.25
With ActiveSheet.Shapes("Oval 1")
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 10
.Fill.Transparency = 0#
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 64
.Line.BackColor.RGB = RGB(255, 255, 255)
'change the color of the line if you wish
End With
Case 0.26 To 0.5
With ActiveSheet.Shapes("Oval 1")
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 13
.Fill.Transparency = 0#
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 64
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
Case Else
With ActiveSheet.Shapes("Oval 1")
.Fill.Visible = msoFalse
.Fill.Transparency = 0#
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoFalse
End With
End Select

End Sub
This message was edited by TsTom on 2002-03-23 16:38
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,354
Members
448,956
Latest member
Adamsxl

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