Calling SUB

  • Thread starter Thread starter Peter Longstaff
  • Start date Start date
P

Peter Longstaff

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
 
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.
 
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
 
Back
Top