Hi,
I have a macro that I use to copy and paste data from a number of reports and I am trying to create a loop that will run the macro on all the files in a certain folder. I have had a go at it but the code I have just opens the first file in the folder that I have selected over and over again. So I'm looking for the code to only open each file once and then move on. Any help would be much appreciated!
Sub Copy()
ChDrive "X:\"
ChDir "X:\Business \ Reports\"
FileToOpen = Application.GetOpenFilename
Do While FileToOpen <> ""
If FileToOpen <> False Then
Workbooks.Open (FileToOpen)
Rest of Macro
Else
Exit Sub
End If
Loop
End Sub
Bookmarks