Copy All Workbooks Sheets(2) Formats & Values only from Folder A toFolder B

U

u473

I tried to adapt Ron de Bruin's code in Copy_Folder(), but I fumbled.
Here is my pseudo-Code :

Prompt for SourceFolder path
Prompt for DestinationFolder Path

If DestinationFolder Does not exist, Create it

For Each workbook in SourceFolder

Copy worksheet(2) values & formats only 'Sheet 2 only, No
formulas, Calculations or Filtering
to DestinationFolder, same original SourceWorkbook.name
Next Workbook

Syntax wise, How do I switch back & forth in my loop from the
SourceFolder Workbooks.Sheets(2) to the DestinationFolder ?

Thank you for your help,

Wayne
 
U

u473

Thank you for your answer, but this is exactly the module
CopyFolder(), I have tried to adapt from.
How do I loop and copy from the Active Sourcefolder,
ActiveWorkbook.worksheets(2).copy Formats & Values.

From his other examples, I could have :

For Each FileInFromFolder In FSO.getfolder(FromPath).files
workbooks.worksheets(2).cells.copy PasteSpecial xlPasteValues
PasteSpecial xlPaste Formats Destination := ToPath
Application.CutCopymode = False
NextFileInFromFolder

Of course this is this For Each block I have trouble with.
 

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