Is there a way in VBA to select a folder with ~20 different Excel Workbooks. Have a loop perform the same task to each workbook in the folder and combine them into one excel workbook?
As of right now I have this code:
[code]
Sub MastercurveCreater()
Workbooks.Add
ActiveWorkbook.SaveAs "N:\******\ MasterCurve Start\" & "InitialSave" & ".xlsx"
SelectData.Show
'
' DataSelection Macro
'
Range("K1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=-30
Range("K1:K68,N1").Select
Range("N1").Activate
Range(Selection, Selection.End(xlDown)).Select
Range("K1:K68,N1:P68").Select
Range("N1").Activate
Selection.Copy
Windows("InitialSave.xlsx").Activate
Range("A1").Select
ActiveSheet.Paste
SaveWorkbook.Show
'You can use this to delete all xlsx files in the folder Test
On Error Resume Next
Kill "N:\MATDEV\MasterCurve Start\" & "InitialSave" & ".xlsx"
On Error GoTo 0
End Sub
[code\]
It takes all the data from one spreadsheet to which I specify and copies and paste it into another blank worksheet.
I would like to do this for all the worksheets in the folder, but am unsure of how to go about doing it.
Any help would be appreciated.
Thanks a lot!
Bookmarks