ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I set up an Excel shape to "fill" with a color (https://www.excelbanter.com/excel-discussion-misc-queries/10837-how-do-i-set-up-excel-shape-%22fill%22-color.html)

JESSENBE

How do I set up an Excel shape to "fill" with a color
 
when "clicked" on (and to "un-fill" when clicked again)?

I would like to make filling shapes function like an option button (on/off)

tjtjjtjt

If your only goal is to toggle the fill on and off, you could put this in a
normal module:

Sub Oval2_Click()
If ActiveSheet.Shapes("Oval 2").Fill.Visible = msoFalse Then
ActiveSheet.Shapes("Oval 2").Fill.Visible = msoTrue
Else
ActiveSheet.Shapes("Oval 2").Fill.Visible = msoFalse
End If
End Sub

Remember to change the name to whatever the name of your shape actually is.

If you right-click on a shape and choose assign macro, you can then assign
this macro to the object. When you click it the fill should be removed. Click
it again, and the fill should be visible again.

tj

"JESSENBE" wrote:

when "clicked" on (and to "un-fill" when clicked again)?

I would like to make filling shapes function like an option button (on/off)



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

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