Thread: Calling SUB
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default 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