code to attach a macro to a newly created worksheet

  • Thread starter Thread starter C. Corodan
  • Start date Start date
C

C. Corodan

Hello,

I have a macro that copies all rows related to a Sales Representative from a
main workbook and creates a new workbook for each Sales Representative. How
do I attach a different macro to one of the sheets of the newly created
workbook?

Thanks,
 
Why not create a template with the macro already in it and then when the
main workgroup creates the new workbook have it create it from the template.
 
Chip Pearson shares some VBA techniques for writing code that writes code.
http://www.cpearson.com/excel/vbe.aspx

Personally, I think creating a template workbook that contains all the code I
need and then using that to create the new workbooks would be lots easier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top