Hallo an alle.
Ich habe folgenden Code und möchte damit alle Dateien in einem Ordner öffnen: Leider öffnet er mir nur die .xlsx Dateien und ich müsste aber noch die .csv Dateien öffnen. Egal was ich bisher versucht habe, es funktioniert leider nicht so wie ich es möchte. :/
Kann mir da jemand behilflich sein?
'UpdateByExtendoffice20160623
Dim xStrPath As String
Dim xFileDialog As FileDialog
Dim xFile As String
On Error Resume Next
Set xFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
xFileDialog.AllowMultiSelect = False
xFileDialog.Title = "Select a folder [Kutools for Excel]"
If xFileDialog.Show = -1 Then
xStrPath = xFileDialog.SelectedItems(1)
End If
If xStrPath = "" Then Exit Sub
xFile = Dir(xStrPath & "\*.xlsx")
Do While xFile <> ""
Workbooks.Open xStrPath & "\" & xFile
xFile = Dir
Loop
|