Hi,
I have a bunch of .xls files in a folder on my desktop (let's call it myFolder).
If I want to copy the contents of worksheet called "Template" in every .xls file in that folder (except for the workbook I am running the macro from) , any suggestions on how to do this? I am creating a macro in the Master file to run. I am concatenating the contents to the "ALLData" worksheet in the active workbook.
-Eileen
Set wbk = ThisWorkbook
Set sht = wbk.Sheets("ALLData")
Generate an array of file names containing .xls files from the folder
Delete the file name from this list where the file name matches the current active workbook
CurrentIndex = 0
' last index is the number of entries in the array
do until CurreintIndex < LastIndex
Workbooks.Open file name in array[current index]
' select rows 2 through the last row of the worksheet to be copied
' copy those rows
' paste those rows after the last row of sht (target sheet)
loop
I have a bunch of .xls files in a folder on my desktop (let's call it myFolder).
If I want to copy the contents of worksheet called "Template" in every .xls file in that folder (except for the workbook I am running the macro from) , any suggestions on how to do this? I am creating a macro in the Master file to run. I am concatenating the contents to the "ALLData" worksheet in the active workbook.
-Eileen
Set wbk = ThisWorkbook
Set sht = wbk.Sheets("ALLData")
Generate an array of file names containing .xls files from the folder
Delete the file name from this list where the file name matches the current active workbook
CurrentIndex = 0
' last index is the number of entries in the array
do until CurreintIndex < LastIndex
Workbooks.Open file name in array[current index]
' select rows 2 through the last row of the worksheet to be copied
' copy those rows
' paste those rows after the last row of sht (target sheet)
loop