Hi,
I'm new to VBA. I'm trying to call a Sub from two different worksheets of the same workbook, but I'm getting an error. Here's what I have.
In Modules -> Module1 I have:
Public Sub ABC()
MsgBox "You are here"
End Sub
In Microsoft Excel Objects -> Sheet1 I have:
Public Sub CommandButton1_Click()
Call ABC
End Sub
In Microsoft Excel Objects -> Sheet2 I have:
Public Sub CommandButton1_Click()
Call ABC
End Sub
When I click the button while on Sheet 1, it works. When I click the button while on Sheet 2, I get "Compile error: Sub or function not defined." Is there a way to get this to work? Thanks!
Bookmarks