copy sheets into a new workbook but not from active workbook

the file with the Macro opens a template, then gets data from various other files and populates the Template. When all of the data has been captured onto the Template I then need to copy all of the sheets on the Template, create a new file with each of the sheets with the names of their respective sheets, which will be saved down.

I have the code to save the file but I need code that will do the creation of the new file, copy all of the sheets and  name the sheets.

Appreciate your help.
JagwarmanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ThomasMcA2Commented:
I then need to copy all of the sheets on the Template, create a new file with each of the sheets with the names of their respective sheets, which will be saved down

That sounds like what the SaveAs function does. Here are some examples:

' Save As
wb.SaveAs Filename:=strNewFileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

' SaveAs closes the current workbook, and activates/opens the new version
ThisWorkbook.SaveAs Environ("Temp") & "\TempNewFile.xlsm"

' SaveCopyAs does not switch to the saved version
ThisWorkbook.SaveCopyAs Environ("Temp") & "\TempNewFile.xlsm"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JagwarmanAuthor Commented:
sorry should have said I need VBA code
0
ThomasMcA2Commented:
That is VBA code.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

JagwarmanAuthor Commented:
yes but it does not copy all the sheets from the other workbook onto a new workbook Does it?

as I said in my question "I have the code to save the file but I need code that will do the creation of the new file, copy all of the sheets and  name the sheets."
0
JagwarmanAuthor Commented:
I take all my comments back and thank you for your help.
1
rimmyCommented:
i want to make a macro for excel which can  copy the data of  file1 in the Master file sheet 1 and the copy of data from another file, file2 in the master file sheet 2.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.