Sub pull_data()
Dim z As Long, e As Long, g As Long
Dim f As String
Sheets("Sheet1").Select
Cells(1, 1) = "=cell(""filename"")"
Cells(1, 2) = "=left(A1,find(""["",A1)-1)"
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.xls")
Do While Len(f) > 0
ActiveCell.Formula = f
ActiveCell.Offset(2, 0).Select
f = Dir()
Loop
z = Cells(Rows.Count, 1).End(xlUp).Row
For e = 2 To z Step 2
Cells(e, 2) = "column A"
Cells(e + 1, 2) = "column B"
For g = 1 To 25
If Cells(e, 1) <> ActiveWorkbook.Name Then
Cells(1, 3) = "='" & Cells(1, 2) & "[" & Cells(e, 1) & "]Acclass'!A" & g
Cells(e, g + 2) = Cells(1, 3)
Cells(1, 3) = "='" & Cells(1, 2) & "[" & Cells(e, 1) & "]Acclass'!B" & g
Cells(e + 1, g + 2) = Cells(1, 3)
End If
Next g
Next e
MsgBox "collating is complete."
End Sub