PC Review


Reply
Thread Tools Rate Thread

code to attach a macro to a newly created worksheet

 
 
C. Corodan
Guest
Posts: n/a
 
      30th Jul 2008
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,
 
Reply With Quote
 
 
 
 
ruic
Guest
Posts: n/a
 
      30th Jul 2008
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.

--
Rui Caetano
IT Manager
Township of East Hanover, NJ

"C. Corodan" <(E-Mail Removed)> wrote in message
news:8E49E2EC-9C56-454A-AA4A-(E-Mail Removed)...
> 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,



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      30th Jul 2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2003: Drop newly created signatures into a newly created pulldown Kpundt Microsoft Outlook Discussion 0 6th May 2010 09:52 PM
Auto Refresh data from original worksheet to newly created copy wolverine Microsoft Excel Misc 0 11th Apr 2010 04:10 PM
Copying & Pasting into a newly created worksheet =?Utf-8?B?Sm9oblVL?= Microsoft Excel Programming 1 13th Oct 2007 02:10 PM
Referencing a newly created worksheet Charyn Microsoft Excel Worksheet Functions 2 2nd May 2005 04:13 AM
Newly Created Image Not Always Found by Following Code Earl Teigrob Microsoft ASP .NET 0 5th Aug 2003 04:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.