Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional formatting of an autoshape

Does anyone know how to change the color of an autoshape
based on an answer given in another cell of the same
workbook?

I need to be able to turn an autoshape red, yellow and
green based on criteria established by my client.

Thanks,

Jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Conditional formatting of an autoshape

If that cell changes value based on typing, then you could use a worksheet
event:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myColor As Long
Dim myShape As Shape

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("a1")) Is Nothing Then Exit Sub

Set myShape = Worksheets("sheet1").Shapes("autoshape 1")

Select Case LCase(Target.Value)
Case Is = "a": myColor = 53
Case Is = "b": myColor = 33
Case Else
myColor = 0
End Select

If myColor = 0 Then
myShape.Fill.Visible = False

Else
With myShape.Fill
.Visible = True
.ForeColor.SchemeColor = myColor
End With
End If

End Sub

Right click on the worksheet tab that contains that cell. Select view code and
paste this in.

Change the address and the shape's name (and rules for colorizing--I recorded a
macro to get the colors I wanted).

jeff g wrote:

Does anyone know how to change the color of an autoshape
based on an answer given in another cell of the same
workbook?

I need to be able to turn an autoshape red, yellow and
green based on criteria established by my client.

Thanks,

Jeff


--

Dave Peterson

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
Conditional Formatting on Autoshape Freshman Excel Worksheet Functions 4 November 19th 09 08:50 AM
fill autoshape color with ref cell conditional formatting Julie Excel Worksheet Functions 1 May 16th 08 05:01 PM
autoshape color conditional formating Dennis Collins Excel Discussion (Misc queries) 11 May 16th 08 01:35 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
How to use a conditional function to insert an autoshape? ToledoMichael Excel Worksheet Functions 1 July 7th 05 02:27 PM


All times are GMT +1. The time now is 09:31 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"