I've drawn a shape that I'd like to use to trigger a macro, and have another shape beneath it (same size, same shape, slightly different properties to simulate a pressed button). Just to test, I wanted to use a macro to shift around the order of the shapes, so I modified code I'd used for a similar purpose... but it doesn't work.
The shapes are named "RISAButtonState1" and "RISAButtonState2", here's the macro I want to trigger when I click the button:
When I run it it highlights the first line and gives me a "Sub or Function undefined" error.
Any idea what's causing that? Any help is greatly appreciated!
[edit: The sub is called RISA_Button_Click (with no underscores)... apparently o n c l i c k with no spaces gets censored? What?]
The shapes are named "RISAButtonState1" and "RISAButtonState2", here's the macro I want to trigger when I click the button:
Code:
Private Sub RISAButt*******()
[COLOR=seagreen]'Bring "pressed button" shape to front[/COLOR]
Shapes("RISAButtonState2").ZOrder msoBringToFront
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond) [COLOR=seagreen]'Wait 2 seconds[/COLOR]
Application.Wait waitTime
[COLOR=seagreen]'Return "unpressed button" shape to front[/COLOR]
Shapes("RISAButtonState1").ZOrder msoBringToFront
End Sub
Any idea what's causing that? Any help is greatly appreciated!
[edit: The sub is called RISA_Button_Click (with no underscores)... apparently o n c l i c k with no spaces gets censored? What?]
Last edited: