ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AutoShape color (https://www.excelbanter.com/excel-programming/428995-autoshape-color.html)

Nikki

AutoShape color
 
I need to make a traffic light using circles- Only one would be "on" at a
time (this doesn't need to be part of the code though).
You would click it to make it fill with color and click again to turn it off.
Thank you for any help you can give. I have tried a number of coding options
and can't get the color part to work.
--
Thanks,
Nikki

Bob Phillips[_3_]

AutoShape color
 

Sub FillShapeColour()
Static fOn As Boolean

With ActiveSheet.Shapes(Application.Caller)

If fOn Then

.Fill.Visible = msoFalse
Else

.Fill.Visible = msoTrue
.Fill.ForeColor.SchemeColor = 10
End If
End With

fOn = Not fOn
End Sub

--
__________________________________
HTH

Bob

"Nikki" wrote in message
...
I need to make a traffic light using circles- Only one would be "on" at a
time (this doesn't need to be part of the code though).
You would click it to make it fill with color and click again to turn it
off.
Thank you for any help you can give. I have tried a number of coding
options
and can't get the color part to work.
--
Thanks,
Nikki




Nikki

AutoShape color
 
Thanks - that is perfect.
--
Thanks,
Nikki


"Bob Phillips" wrote:


Sub FillShapeColour()
Static fOn As Boolean

With ActiveSheet.Shapes(Application.Caller)

If fOn Then

.Fill.Visible = msoFalse
Else

.Fill.Visible = msoTrue
.Fill.ForeColor.SchemeColor = 10
End If
End With

fOn = Not fOn
End Sub

--
__________________________________
HTH

Bob

"Nikki" wrote in message
...
I need to make a traffic light using circles- Only one would be "on" at a
time (this doesn't need to be part of the code though).
You would click it to make it fill with color and click again to turn it
off.
Thank you for any help you can give. I have tried a number of coding
options
and can't get the color part to work.
--
Thanks,
Nikki






All times are GMT +1. The time now is 05:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com