Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Macro Along with Worksheet

Status
Not open for further replies.

pcb105

Technical User
Apr 25, 2007
11
US
Hi All,

Sorry if this is posted somewhere else. I have a question on how to create New Excel Worksheets from a Master.

I am running a repair department at a company. I have a sheet that lists all of the units we have to repair. I have another sheet (workshop Master report) in the same workbook that I make a copy of and fill in some of the details. I have created a VBScript that allows me to save off the sheet in a new workbook. I am using the following commands:

Sheets(WSRTemp).Copy
ActiveWorkbook.SaveAs Filename:=WSRFilename &".xls", FileFormat:=xlWorkbookNormal
ActiveWorkbook.Close

The data copies fine. I am having problems trying to figure out how to copy the macros. I have created some macros that enable the repair staff update the sheets easier.

Thanks in advance.
 
Why not using a template (.xlt) instead ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have to agree; a template is the way to go.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Hi All,

I just got back from travel and being out sick. Thanks for the ideas. I do have a question.... What do you mean use a template? I create a new sheet in a workbook from a master list of 1000s of entries. I then save off a filtered workbook in a different file. I want to also copy over a few macros (written in vbscribt) so that the user can do some other sorting if needed. I am not sure what you mean by using a template.

Thanks for your help,

-Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top