Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Programmatically insert a graphic?

I have a spreadsheet where I want to create a traffic light view of the
data. For example:

Value 1-3 = red circle
Value 4-6 = yellow circle
Value 7-10 = green circle

The formula I'm working with looks like this:

=IF(Sheet1!B2<4,red,IF(Sheet1!B2<7,yellow,green))

The red, yellow, and green items need to pull graphic symbols which is where
I'm struggling. How can I do that?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Programmatically insert a graphic?

Here's just an idea of a VBA module that could do the work for you:

Sub Circles()

Sheets("Sheet1").Activate
Select Case ActiveSheet.Range("B2")
Case Is = 7
'Change 20, 20, 50, 50 to adjust the size and location of the circles
ActiveSheet.Shapes.AddShape(msoShapeOval, 20, 20, 50, 50).Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 11
Selection.ShapeRange.Line.Visible = msoFalse
Case Is = 4
ActiveSheet.Shapes.AddShape(msoShapeOval, 20, 20, 50, 50).Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 5
Selection.ShapeRange.Line.Visible = msoFalse
Case Else
ActiveSheet.Shapes.AddShape(msoShapeOval, 20, 20, 50, 50).Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
Selection.ShapeRange.Line.Visible = msoFalse
End Select

End Sub


--------
Cheers,
Anony


"Kent McPherson" wrote:

I have a spreadsheet where I want to create a traffic light view of the
data. For example:

Value 1-3 = red circle
Value 4-6 = yellow circle
Value 7-10 = green circle

The formula I'm working with looks like this:

=IF(Sheet1!B2<4,red,IF(Sheet1!B2<7,yellow,green))

The red, yellow, and green items need to pull graphic symbols which is where
I'm struggling. How can I do that?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert a graphic into header of spreadsheet JMay Excel Discussion (Misc queries) 0 November 29th 06 08:34 PM
How do I insert a graphic into header of spreadsheet Gary''s Student Excel Discussion (Misc queries) 0 November 29th 06 08:27 PM
How do I insert a graphic into header of spreadsheet Al Nichols Excel Discussion (Misc queries) 0 November 29th 06 08:18 PM
How do I programmatically get access to a picture or graphic? Stumpiana Excel Programming 2 November 18th 05 05:18 AM
Insert a graphic in a cell Pete_Escher fan Excel Discussion (Misc queries) 1 February 10th 05 06:04 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"