LactoseO.D.'d
Board Regular
- Joined
- Feb 22, 2010
- Messages
- 52
I have a hidden worksheet that copies itself and creates a new worksheet. On the worksheet I have a command button that I have assigned a macro to:
However, I have an issue as to where I store the Macro. Though the macro executes, it only does so if the code for it is stored on the worksheet object. This gives a 1004 error because the macro itself references another worksheet. When I put the macro in a module and tried making the macro global, the reference to it on the command button no longer works. How do I fix this?
Code:
Private Sub CommandButton3_Click()
Call MacroName
End Sub
However, I have an issue as to where I store the Macro. Though the macro executes, it only does so if the code for it is stored on the worksheet object. This gives a 1004 error because the macro itself references another worksheet. When I put the macro in a module and tried making the macro global, the reference to it on the command button no longer works. How do I fix this?