Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2003, and probably just a syntax issue. Googled but wasn't able to find
relevant content. I recorded a macro to grab a bunch of sheet formatting. I have many similar sheets that all need to be formatted the same, so I want to use the recorded macro and just pass the worksheet name as a parameter- so after I add all the data to each worksheet, I can format it and move on. In my limited experience with passing values between subs/functions I know the value has to be the same type (if a function is expecting an integer value, I not only have to pass it an integer, but I actually have to define the variable in the source procedure as an integer (ok, I admit I rarely use option strict on). So, I tweaked the recorded procedure name to be: Sub CleanUpSheets(mWorksheet As Worksheet) and in my main procedure I use the sheet codename (because users will be changing the tab names), and so I use: .... CleanUpSheets(Sheet92) which results in a run time error 438: object doesn't support this property or method. I didn't define the sheet, because it is the sheet codename. Just for kicks, I tried it anyway: Dim Sheet92 as worksheet ...but then I get a runtime error 91 when I tried to access Sheet92 in the main code. So... what is the proper syntax (on both subs) to pass a worksheet as a parameter, so the receiving sub knows which worksheet to format? Many thanks, Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is it possible to pass a parameter into IN operator in Query? | Excel Discussion (Misc queries) | |||
pass parameter to Query | Excel Programming | |||
Pass worksheet to macro as a parameter | Excel Programming | |||
Pass Parameter to Access Query | Excel Programming | |||
Pass parameter to a form and then open it? | Excel Programming |