How do I set up an Excel shape to "fill" with a color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

I would like to make filling shapes function like an option button (on/off)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top