PDA

View Full Version : Solved: Calling subs in modules/sheet modules



philfer
01-03-2008, 01:43 PM
I have code in a userform module and behind a worksheet i.e. "Sheet1"

I can get the code in Sheet1 to call the UserForm_Activate sub in the userform code module but cant get the userform sub to call a sub in the sheet code module.

None of the subs are private.

If I move the sub from the sheet module into a module (i.e. the last part of the project tree) it works just fine.

Is this a general VBA rule or have I dont something wrong

Bob Phillips
01-03-2008, 02:43 PM
Precede the procedure with the class name (the module name) and that should work

Call Sheet1.The_Proc