Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default code to attach a macro to a newly created worksheet

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,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default code to attach a macro to a newly created worksheet

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" wrote in message
...
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,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default code to attach a macro to a newly created worksheet

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Refresh data from original worksheet to newly created copy wolverine Excel Discussion (Misc queries) 0 April 11th 10 04:10 PM
how to paste macro to a newly created file using vba noobi Excel Programming 1 April 1st 08 01:33 AM
Copying & Pasting into a newly created worksheet JohnUK Excel Programming 1 October 13th 07 02:10 PM
Referencing a newly created worksheet Charyn Excel Worksheet Functions 2 May 2nd 05 04:13 AM
How do I return to newly created worksheet? JJ[_5_] Excel Programming 3 December 29th 03 08:36 PM


All times are GMT +1. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"