Hi,
I would like my macro below to have a loop, having it open every file in the folder one at a time, then copy some of that opened file’s data into the summary file, then close the file and open the next file and copy some of its’ data to the summary file, etc. I’m unsure on how to make the individual file names variable… all the files will start with “ProWellness Walking Campaign-” and then it will have each person’s name attached to the end of the file name.. I’m not sure that that is even important as I want every file in the folder to be opened (regardless of it’s file name), however they need to be opened one at a time, thus the looping thingy. As always, your help is very much appreciated!
Thanks!!
Lana
Sub Consol()
‘Open the first file in the folder and retreive the goal & actual data
ChDir “K:GroupsWellness”
Workbooks.Open Filename:= _
“K:GroupsWellnessProWellness Walking Campaign-Lana.xls”
‘Copy & Paste the Goals worksheet to the Summary file
Windows(“ProWellness Walking Campaign-Lana.xls”).Activate
Sheets(“Goal”).Select
Range(“A7:K16”).Select
Selection.Copy
Windows(“ProWellness Walking Campaign-Summary.xls”).Activate
Sheet2.Select
Range(“A65536”).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
‘Copy & Paste the Actual worksheet to the Summary file
Windows(“ProWellness Walking Campaign-Lana.xls”).Activate
Sheets(“Actual”).Select
Range(“A15:K24”).Select
Application.CutCopyMode = False
Selection.Copy
Windows(“ProWellness Walking Campaign-Summary.xls”).Activate
Sheet2.Select
Range(“A65536”).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Windows(“ProWellness Walking Campaign-Lana.xls”).Activate
ActiveWindow.Close
End Sub