Can I use a macro to create a macro in a new workbook?

B

Bernie Deitrick

The easiest thing it to create a template with the required code, and use that template as the basis
of the workbook that you create when you split the single worksheet. Use code like

Dim myB As Workbook
Set myB = Workbooks.Add("C:\Folder\Template Name.xlt")

HTH,
Bernie
MS Excel MVP
 
P

Paul

The template idea is a good one.

The downside is that if you want to change the code you'll need to change
all the files that have the code embedded. This means keeping a list of all
the files that contain such code.

The alternative is to use one line of code that calls a routine in a file
that contains the macro code. Then changes only need to be made once.
The downside to this format is that everyone that needs to use the file (and
its code) need access to the file containing the macros.
 
D

DAN MOORE

Cheers Bernie, simple solution, thanks.



Bernie Deitrick wrote:

The easiest thing it to create a template with the required code, and use that
19-Nov-09

The easiest thing it to create a template with the required code, and use that template as the basi
of the workbook that you create when you split the single worksheet. Use code lik

Dim myB As Workboo
Set myB = Workbooks.Add("C:\Folder\Template Name.xlt"

HTH
Berni
MS Excel MVP

Previous Posts In This Thread:

EggHeadCafe - Software Developer Portal of Choice
Retrieve Hardware Identifiers in C# with WMI
http://www.eggheadcafe.com/tutorial...9-d32bb8a1550b/retrieve-hardware-identif.aspx
 

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

Top