dvenn
02-23-2006, 02:15 PM
okay.. having learned so much from here... I think I am ready to move into functions..
Here is what I want to try...
Public Function DoStuff (Proc as ??)
Load userform1
Applications.OnTime Now + TimeValue("00:00:01"), Proc
End Function
Proc = a macro name..
The userform actually watches the macros run.. and captures information (I have that part), and until now I was running this as a sub.. but I added another routine that I want the user form to watch... so instead of doing seomthing like adding a second copy of the sub.. i thought "If I could pass the maro name to a function then I wouldn't need to do that.."
anyways.. I tried as String, as Variant, & as Object but I get and error on the line in the macro
doStuff somemacro
compile Error:
expected Function or variable
:help
Here is what I want to try...
Public Function DoStuff (Proc as ??)
Load userform1
Applications.OnTime Now + TimeValue("00:00:01"), Proc
End Function
Proc = a macro name..
The userform actually watches the macros run.. and captures information (I have that part), and until now I was running this as a sub.. but I added another routine that I want the user form to watch... so instead of doing seomthing like adding a second copy of the sub.. i thought "If I could pass the maro name to a function then I wouldn't need to do that.."
anyways.. I tried as String, as Variant, & as Object but I get and error on the line in the macro
doStuff somemacro
compile Error:
expected Function or variable
:help