Hi Excel Gods,
I am looking to tweak below VBA code to be able to open X number of CSV file (; delimited) and to have the CSV file in the excel workbook as text (All columns).
The current issue is that all the information per sheet are whitin one col
thanks in advance
Sub test()
Dim myDir As String, fn As String, wb As Workbook
Set wb = ActiveWorkbook
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then myDir = .SelectedItems(1) & ""
End With
If myDir = "" Then Exit Sub
fn = Dir(myDir & "*.csv")
Do While fn <> ""
With Workbooks.Open(myDir & fn)
.Sheets(1).Copy after:=wb.Sheets(wb.Sheets.Count)
.Close False
End With
fn = Dir
Loop
End Sub
I am looking to tweak below VBA code to be able to open X number of CSV file (; delimited) and to have the CSV file in the excel workbook as text (All columns).
The current issue is that all the information per sheet are whitin one col
thanks in advance
Sub test()
Dim myDir As String, fn As String, wb As Workbook
Set wb = ActiveWorkbook
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then myDir = .SelectedItems(1) & ""
End With
If myDir = "" Then Exit Sub
fn = Dir(myDir & "*.csv")
Do While fn <> ""
With Workbooks.Open(myDir & fn)
.Sheets(1).Copy after:=wb.Sheets(wb.Sheets.Count)
.Close False
End With
fn = Dir
Loop
End Sub