'Opens ALL files in a folder, manipulates then saves as Excel
Dim fName As String
'Path with the files to convert
ChDir "C:\My Documents\Excel Files"
'Create a list of the files in that folder
fName = Dir("*")
'Open files one at a time to process them
Do While Len(fName) > 0
'Open file
Workbooks.OpenText Filename:=fName, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 3), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 3), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), _
Array(21, 1), Array(22, 1), Array(23, 1), Array(24, 1), Array(25, 1), Array(26, 1), Array(27, 1), Array(28, 1), Array(29, 1), Array(30, 1), Array(31, 1), Array(32, 1), _
Array(33, 1), Array(34, 3), Array(35, 1), Array(36, 1), Array(37, 1), Array(38, 1), Array(39, 1)), TrailingMinusNumbers:=True
'Date format columns
Range("H:H,O:O,AH:AH").NumberFormat = "m/d/yyyy"
'your further code here
'Save to same directory as Excel file with same name
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal, CreateBackup:=False
'Get next filename
fName = Dir
'Close current file before moving on
ThisWorkbook.Close
Loop
MsgBox "Complete"
End Sub
Bookmarks