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.
C. Corodan wrote:
>
> 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,
--
Dave Peterson