I was wondering if anyone could assist please. I have created a logger in which multiple users are going into excel and a userform will log all the details. Each user has a separate file and then subsequently a master sheet will pull loop through their excel sheets for the data and pull it altogether.
We now have a new system that will pull through text files (unfortunately only txt files).
I have now set up all users to export their individual data as a txt file. However I am having trouble now with the mastersheet looping through the data and adding the next user underneath.
My old code is:
Sub Theloopofloops()
Dim wbk As Workbook
Dim Filename As String
Dim path As String
Dim rCell As Range
Dim wsO As Worksheet
path = "L:\MK\Logger\"
Filename = Dir(path & "*.xlsm")
Set wsO = ThisWorkbook.Sheets("Master")
Do While Len(Filename) > 0
DoEvents
Set wbk = Workbooks.Open(path & Filename, True, True)
For Each rCell In wbk.Worksheets("Calls").Range("A2:A2000").Cells
If rCell <> "" And rCell.Value <> vbNullString And rCell.Value <> 0 Then
wsO.Cells(wsO.Rows.Count, 1).End(xlUp).Offset(1, 0).Resize(, 16).Value = rCell.Resize(, 16).Value
End If
Next rCell
wbk.Close False
Filename = Dir
Loop
Obviously this was looping through workbooks. Any assistance would be greatly appreciated.
Thanks,