Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wonder if some can help\suggest, I'm creating a report and would like to
add shape to represent status. Is it possible to automate the shape to shorw red, amber or green by clicking on it? Can I assign a dropdown to a shape or do I need to write a macro and assign it to a shape? Please advise. Afia |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Alfa,
Try assignin the shapes to the following macro: '============= Public Sub Tester() Dim SHP As Shape Set SHP = ActiveSheet.Shapes(Application.Caller) With SHP.Fill.ForeColor Select Case .RGB Case vbGreen: .RGB = vbYellow Case vbYellow: .RGB = vbRed Case Else: .RGB = vbGreen End Select End With End Sub '<<============= Succesive clicks will cycle the shape's colour through green, amber and red; --- Regards, Norman "Afia" wrote in message ... I wonder if some can help\suggest, I'm creating a report and would like to add shape to represent status. Is it possible to automate the shape to shorw red, amber or green by clicking on it? Can I assign a dropdown to a shape or do I need to write a macro and assign it to a shape? Please advise. Afia |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, it works and brilliant!!!
Can I make the shape to automate its fore colour as in the cell? Say c4:w4 got conditional formatting for Red, amber and green and if I add shape to each cell, can it be automated as the cell text? -- Afia "Norman Jones" wrote: Hi Alfa, Try assignin the shapes to the following macro: '============= Public Sub Tester() Dim SHP As Shape Set SHP = ActiveSheet.Shapes(Application.Caller) With SHP.Fill.ForeColor Select Case .RGB Case vbGreen: .RGB = vbYellow Case vbYellow: .RGB = vbRed Case Else: .RGB = vbGreen End Select End With End Sub '<<============= Succesive clicks will cycle the shape's colour through green, amber and red; --- Regards, Norman "Afia" wrote in message ... I wonder if some can help\suggest, I'm creating a report and would like to add shape to represent status. Is it possible to automate the shape to shorw red, amber or green by clicking on it? Can I assign a dropdown to a shape or do I need to write a macro and assign it to a shape? Please advise. Afia |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Afia,
Perhaps youcould utilise the shape's TopLeftCell property to identify the cell of interest and you could use the same conditions as used for the conditional formatting to determine the shape's colour. Perhaps, for example, try something like: '============= Public Sub Tester() Dim SHP As Shape Set SHP = ActiveSheet.Shapes(Application.Caller) With SHP.Fill.ForeColor Select Case SHP.TopLeftCell.Value Case Is <= 10: .RGB = vbYellow Case Is <= 50: .RGB = vbRed Case Is <= 100: .RGB = vbGreen Case Else: .RGB = vbMagenta End Select End With End Sub '<<============= --- Regards, Norman "Afia" wrote in message ... Thank you, it works and brilliant!!! Can I make the shape to automate its fore colour as in the cell? Say c4:w4 got conditional formatting for Red, amber and green and if I add shape to each cell, can it be automated as the cell text? -- Afia |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro for Tab colour change | Excel Discussion (Misc queries) | |||
Colour macro | Excel Discussion (Misc queries) | |||
Change Tab colour using Macro | Excel Worksheet Functions | |||
Font Colour Macro | Excel Programming | |||
Colour Macro | Excel Programming |