Try this...
Code:
Sub LoopFolder()
Dim strFile As String
Dim strFileType As String
Dim strPath As String
Dim lngLoop As Long
Dim wbk As Workbook
strPath = "C:\ExcelFox"
strFileType = "Book*.xlsx" 'Split with semi-colon if you want to specify the file types. Example ->> "*.xls;*.doc"
For lngLoop = LBound(Split(strFileType, ";")) To UBound(Split(strFileType, ";"))
strFile = Dir(strPath & "\" & Split(strFileType, ";")(lngLoop))
Do While strFile <> ""
Set wbk = Workbooks.Open(strPath & "\" & strFile, False, True)
With wbk.Sheets(1)
.Range("A:A").TextToColumns Destination:=.Range("A1")
.Parent.Close 1
End With
Loop
Next lngLoop
strFile = vbNullString
strFileType = vbNullString
strPath = vbNullString
lngLoop = Empty
End Sub
Bookmarks