PC Review


Reply
Thread Tools Rate Thread

Copy VBA Module to new workbook

 
 
Mark
Guest
Posts: n/a
 
      26th Mar 2008
I have a script that I run the formats a bunch of data and copies 5 sheets
and puts them in a new work book. I want to add an autorun module to this
new book. I'm not sure if it is easier to add the module from scratch or
copy it, but I want the module to be there when the other code I have saves
the new work book.

Can anyone offer any suggestions?

thanks!
Mark
 
Reply With Quote
 
 
 
 
PatrickS
Guest
Posts: n/a
 
      26th Mar 2008
You might find the following web page of interest:

http://www.cpearson.com/excel/vbe.aspx

"Mark" wrote:

> I have a script that I run the formats a bunch of data and copies 5 sheets
> and puts them in a new work book. I want to add an autorun module to this
> new book. I'm not sure if it is easier to add the module from scratch or
> copy it, but I want the module to be there when the other code I have saves
> the new work book.
>
> Can anyone offer any suggestions?
>
> thanks!
> Mark

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      26th Mar 2008
Create a template file with the code, layouts etc already in-situ. Then
when creating a new workbook use the template.

--

Regards,
Nigel
(E-Mail Removed)



"Mark" <(E-Mail Removed)> wrote in message
news:C55DB625-3FA5-46A1-9F0F-(E-Mail Removed)...
>I have a script that I run the formats a bunch of data and copies 5 sheets
> and puts them in a new work book. I want to add an autorun module to this
> new book. I'm not sure if it is easier to add the module from scratch or
> copy it, but I want the module to be there when the other code I have
> saves
> the new work book.
>
> Can anyone offer any suggestions?
>
> thanks!
> Mark


 
Reply With Quote
 
PWillis
Guest
Posts: n/a
 
      26th Mar 2008
Mark wrote:
> I have a script that I run the formats a bunch of data and copies 5 sheets
> and puts them in a new work book. I want to add an autorun module to this
> new book. I'm not sure if it is easier to add the module from scratch or
> copy it, but I want the module to be there when the other code I have saves
> the new work book.
>
> Can anyone offer any suggestions?
>
> thanks!
> Mark


Make an excel addin that contains your module. That way the module is
available to all workbooks as long as the addin is selected in excel.

P
 
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
Copy Module to new Workbook Little Penny Microsoft Excel Programming 4 16th Sep 2007 03:18 PM
How to copy module form one workbook to another deepakmehta Microsoft Excel Programming 4 8th May 2006 10:03 PM
Run worksheet module code from workbook module? keithb Microsoft Excel Programming 1 14th Aug 2005 04:04 AM
re: Automatically Delete WorkBook 2 modules by using Workbook 1 module =?Utf-8?B?ZGRpaWNj?= Microsoft Excel Programming 5 27th Jul 2005 12:53 PM
Copy VBA Module and Form from Workbook to another workbook topaiva Microsoft Excel Programming 1 25th Nov 2004 03:47 PM


Features
 

Advertising
 

Newsgroups
 


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