I suppose some more manipulation is required, this is why I went with the helper sheet in the first place, I forgot to add the sort part though
Sub Button1_Click()
Dim r As Range, c As Range, cl As Range, wb1 As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet, x As Integer
Dim Str1 As String, Str2 As String
Dim rw As Long
Set wb1 = Workbooks("10_2010_Store#1_DailySalesX")
Set ws2 = wb1.Worksheets("Daily_Receipt")
Str1 = "REG_CNTR"
Str2 = "REG_TOTAL"
Application.ScreenUpdating = False
Sheets.Add().Name = "List"
Set ws1 = Worksheets("List")
myFile = Dir(ActiveWorkbook.Path & "\*.xls")
i = 1
Do While myFile <> ""
If myFile <> ActiveWorkbook.Name Then
Cells(i, 2) = myFile'this is the bolded code
i = i + 1
End If
myFile = Dir
Loop
rw = ActiveSheet.UsedRange.Rows.Count
ws1.Columns("B:B").TextToColumns Destination:=Range("B1"), Other:=True, OtherChar:="-"
ws1.Columns("B:D").Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1:A" & rw) = "=RC[1]&""-""&RC[2]&""-""&RC[3]"
Set r = ws1.Range("A1", ws1.Range("A65536").End(xlUp))
Set rng = ws2.Range("A1")
x = 16
For Each c In r.Cells
Workbooks.Open Filename:="E:\WorkBookLoop\" & c '***************CHANGE THIS
Range(ws2.Cells(119, x), ws2.Cells(178, x + 1)).Copy Destination:=ActiveWorkbook.Worksheets("Sheet1").Range("A2")
ActiveWorkbook.Worksheets("Sheet1").Range("A1") = Str1
ActiveWorkbook.Worksheets("Sheet1").Range("B1") = Str2
ActiveWorkbook.Close Save = False
x = x + 4
Next c
With Application
.DisplayAlerts = False
Sheets("List").Delete
.DisplayAlerts = True
End With
MsgBox "Done !!"
End Sub
Bookmarks