Edit Macro to have button "Unglow" when another button is selected.

klopera1

New Member
Joined
Apr 14, 2014
Messages
10
I have the following Macro which adds a glow to a shape when clicked.

Sub IsoscelesTriangle2_Click()
'
' IsoscelesTriangle2_Click Macro

Dim Shp As Shape

Set Shp = ActiveSheet.Shapes(Application.Caller)
With Shp.Glow
.Color = RGB(0, 255, 0)
.Radius = IIf(.Radius = 0, 10, 0)
End With

End Sub

However, I would it to UNGLOW (go back to normal) when any other button is clicked

I've 3 triangles as buttons.

Thank You!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi klopera1 - Interestingly, when I run your code, modified slightly to select the oval I named Shape100, it turns the "Glow" on. When I run it again, with no modifications, it turns the "Glow" off. Hope this helps.
Code:
Sub IsoscelesTriangle2_Click()
' IsoscelesTriangle2_Click Macro
Dim Shp As Shape
'Set Shp = ActiveSheet.Shapes(Application.Caller)
Set Shp = ActiveSheet.Shapes("Shape100")
    With Shp.Glow
    .Color = RGB(0, 255, 0)
    .Radius = IIf(.Radius = 0, 10, 0)
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top