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!
 

goesr

Well-known Member
Joined
Nov 15, 2013
Messages
617
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
 

Forum statistics

Threads
1,085,294
Messages
5,382,766
Members
401,804
Latest member
RB85

Some videos you may like

This Week's Hot Topics

Top