Originally Posted by
mdmackillop
[vba]Sub SortAndImportData(wb As Workbook)
Dim Headings, h, c As Long
Headings = Array("PMTDT", "INVDT", "AMT", "INV#")
With wb.Sheets(1)
For Each h In Headings
c = .Rows(1).Find(h).Column
.Columns(c).Cut
.Columns(1).Insert
Next
Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp)).Resize(, 4).Copy
End With
Sheets("Master").Cells(Rows.Count, 1).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Application.DisplayAlerts = False
wb.Close False
Application.DisplayAlerts = True
End Sub
[/vba]