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.
"Bernie Deitrick" wrote:
> 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
>
>
> <DANMOO> wrote in message news:(E-Mail Removed)...
> >I have a macro that splits data in a single worksheet into multiple workbooks based on a change of
> >data in a particular row.
> >
> > Is there a way within this macro to make it create a script in the new workbook that runs when
> > certain cells are altered?
> >
> > EggHeadCafe - Software Developer Portal of Choice
> > .NET Compact Framework Missing DataTable .Copy()
> > http://www.eggheadcafe.com/tutorials...mework-mi.aspx
>
>
> .
>