This should be so easy, but I can't figure it out. I have a PowerPoint slide with a command button (Button1). When I click the button, I want VBA to call another subroutine (ChangeColor) that changes the button's color depending on several conditions. I do not want to harcode the button's name in ChangeColor since several other buttons may call that same routine. Instead, I need ChangeColor to determine which button was just clicked (is active or has focus) and then change its color.
A sample of my code is below. The part I can't figure out is in brackets. Can someone please help? Thanks!
Private Sub Button1_Click()
Call ChangeColor
End Sub
Private Sub ChangeColor()
[How do I reference the currently active button here?].BackColor = RGB(0, 176, 80)
End Sub
A sample of my code is below. The part I can't figure out is in brackets. Can someone please help? Thanks!
Private Sub Button1_Click()
Call ChangeColor
End Sub
Private Sub ChangeColor()
[How do I reference the currently active button here?].BackColor = RGB(0, 176, 80)
End Sub