T
Thanks
Hello
I have been using the following code to open files Until now the files were
supplied as .xls files. However now they are being supplied as .csv Files.
Dim MyPath As String
Dim FilesInPath As String
Dim MyFiles() As String
Dim SourceRcount As Long
Dim Fnum As Long
Dim mybook As Workbook
Dim basebook As Workbook
Dim sourceRange As Range
Dim destrange As Range
Dim rnum As Long
Dim sfolder As String
sfolder = ThisWorkbook.Path
MyPath = sfolder
MsgBox (MyPath)
If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If
FilesInPath = Dir(MyPath & "*.xls")
MsgBox (FilesInPath)
If FilesInPath = "" Then
MsgBox "No files found"
Exit Sub
End If
How do I modify to open the .csv files. Changing FilesInPath = Dir(MyPath
& "*.xls")
to
FilesInPath = Dir(MyPath & "*.csv"), doesn't work.
I have been using the following code to open files Until now the files were
supplied as .xls files. However now they are being supplied as .csv Files.
Dim MyPath As String
Dim FilesInPath As String
Dim MyFiles() As String
Dim SourceRcount As Long
Dim Fnum As Long
Dim mybook As Workbook
Dim basebook As Workbook
Dim sourceRange As Range
Dim destrange As Range
Dim rnum As Long
Dim sfolder As String
sfolder = ThisWorkbook.Path
MyPath = sfolder
MsgBox (MyPath)
If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If
FilesInPath = Dir(MyPath & "*.xls")
MsgBox (FilesInPath)
If FilesInPath = "" Then
MsgBox "No files found"
Exit Sub
End If
How do I modify to open the .csv files. Changing FilesInPath = Dir(MyPath
& "*.xls")
to
FilesInPath = Dir(MyPath & "*.csv"), doesn't work.