PeterMoran
MIS
Hi,
I have the following macro which lists "*.csv" files for my selection from a specific folder.
Sub CSVOpen()
'
' CSVOpen Macro to Open Window for *.csv files in dir "Super"
' Written PJM 26/2/14
'
Dim myFileName As Variant
Dim Wkbk As Workbook
ChDir "C:\Users\Peter\Documents\Super"
myFileName = Application.GetOpenFilename("Text files, *.csv")
If myFileName = False Then
ChDir "C:\Users\Peter\Documents"
Exit Sub 'user hits Cancel
End If
Workbooks.OpenText Filename:=myFileName 'Open selected file
ChDir "C:\Users\Peter\Documents" 'Reset CurDir to "Documents" for next use.
End Sub
I want to modify it to only display csv files in the window with filenames ending in "abc" eg "15-01Dataabc.csv".
How can I do this in this macro?
Thanks in anticipation,
Peter Moran
I have the following macro which lists "*.csv" files for my selection from a specific folder.
Sub CSVOpen()
'
' CSVOpen Macro to Open Window for *.csv files in dir "Super"
' Written PJM 26/2/14
'
Dim myFileName As Variant
Dim Wkbk As Workbook
ChDir "C:\Users\Peter\Documents\Super"
myFileName = Application.GetOpenFilename("Text files, *.csv")
If myFileName = False Then
ChDir "C:\Users\Peter\Documents"
Exit Sub 'user hits Cancel
End If
Workbooks.OpenText Filename:=myFileName 'Open selected file
ChDir "C:\Users\Peter\Documents" 'Reset CurDir to "Documents" for next use.
End Sub
I want to modify it to only display csv files in the window with filenames ending in "abc" eg "15-01Dataabc.csv".
How can I do this in this macro?
Thanks in anticipation,
Peter Moran