Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling SUB
Hi All,
I do not write a lot of VB so this will probably seem like a dumb question but here goes. I have written a sub routine ( in ThisWorkbook) which prints the sheets I require in a workbook template. I now want to call this sub routine from a button on a toolbar in my template. Can anyone tell me how I can do this TIA Peter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling SUB
Peter
First, move the sub from ThisWorkbook to a standard module (Insert - Module if you don't have one yet). Then set the OnAction property of the commandbarbutton to the name of the sub. Unless you're using a Workbook level event, you probably don't need the sub in ThisWorkbook. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Peter Longstaff" wrote in message . .. Hi All, I do not write a lot of VB so this will probably seem like a dumb question but here goes. I have written a sub routine ( in ThisWorkbook) which prints the sheets I require in a workbook template. I now want to call this sub routine from a button on a toolbar in my template. Can anyone tell me how I can do this TIA Peter |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling SUB
"Dick Kusleika" wrote in
: Peter First, move the sub from ThisWorkbook to a standard module (Insert - Module if you don't have one yet). Then set the OnAction property of the commandbarbutton to the name of the sub. Unless you're using a Workbook level event, you probably don't need the sub in ThisWorkbook. Hi Dick, that's done it. Thank you Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calling a function in my SQL-DB from VBA | Excel Discussion (Misc queries) | |||
HELP!!!! Calling a sub from Workbook_BeforeSave | Excel Discussion (Misc queries) | |||
Calling an Add-In | Excel Discussion (Misc queries) | |||
Calling Solver from VBA | Excel Programming | |||
Calling certain functions within VBA | Excel Programming |