public macros

T

TommyBoy

i created a windows form that allows you to select a pay roll file, the
pay roll file has a sheet for each employee, the form lets you select
each employee you want to their sheet to. I created a macro in excel
that emails the sheet as the body and everything is working fine. My
problem is that there will be a different pay roll file for each pay
period, how do i make my macro public so any pay roll file can access
it? Thanks in advance
 
B

Bob Phillips

Tommy,

Macros in a standard module are b y default public, unless you explicitly
make them private. The trick is to have an argument that allows the variable
file name to be passed.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

Top