I have a set of workbooks in a folder on my Desktop, each of which has a timecard in it on a worksheet called Weekly Time Sheet. On each of the sheets, I'm interested in totals that appear in E14 through K14 (7 cells), and I want to loop through the workbooks, open them, copy the contents of E14:K14 to a grid on a master workbook first to B3:H3, then to C3:H3, then to D3:H3, and so forth until I've processed all the workbooks in the folder. Then I guess I need to close all of the workbooks and put up a message box indicating that the transfer process is complete.
I have code so far that does the looping, and to test it, I put up a simple message box with each file's name. I need to replace that message routine with the routine that copies the data, but I don't know how to do that part.
Here's my code:
Any help would be much appreciated.
I have code so far that does the looping, and to test it, I put up a simple message box with each file's name. I need to replace that message routine with the routine that copies the data, but I don't know how to do that part.
Here's my code:
Code:
Sub LoopThroughFiles()
Dim MyObj As Object, MySource As Object, file As Variant
file = Dir("C:\Users\m10647\Desktop\Input timecard worksheets\")
While (file <> "")
MsgBox "found " & file
file = Dir
Wend
End Sub
Any help would be much appreciated.