I have a very simple macro in Excel that selects a sheet that is passed in - something like:
Sub GetSheet (strSheet As String)
Sheets(strSheet).Select
End Sub
This macro works running it by itself or if attaching to a command button. Now, when I create a custom menu and attach this macro to the .onAction of the menu item, it will not work. I have inserted a MsgBox command in the macro, so I know it's getting to it, but the other sheet is not being selected. Any ideas?
Sub GetSheet (strSheet As String)
Sheets(strSheet).Select
End Sub
This macro works running it by itself or if attaching to a command button. Now, when I create a custom menu and attach this macro to the .onAction of the menu item, it will not work. I have inserted a MsgBox command in the macro, so I know it's getting to it, but the other sheet is not being selected. Any ideas?