Some sample code then:
Sub GetOpenFileNameExample2()
Dim vFilename As Variant
Dim sPath As String
Dim lFilecount As Long
Dim lCount As Long
sPath = "c:\windows\temp\"
ChDrive sPath
ChDir sPath
vFilename = Application.GetOpenFilename("text files (*.csv),*.csv", , "Please select the file(s) to import", , True)
If TypeName(vFilename) = "Boolean" Then Exit Sub
For lCount = LBound(vFilename) To UBound(vFilename)
ImportThisOne CStr(vFilename(lCount))
Next
End Sub
Sub ImportThisOne(sFileName As String)
Dim oBook As Workbook
Workbooks.Open sFileName
Set oBook = ActiveWorkbook
'Now do your processing on the newly imported sheet
'Copy new sheet into this workbook
With oBook.Worksheets(1).UsedRange
'filter out any foobars in column 1
.AutoFilter 1, "<>foobar"
.SpecialCells(xlCellTypeVisible).Copy
oBook.Worksheets.Add
ActiveSheet.Paste
oBook.SaveAs "csv2.csv", xlCSV
End With
'close text file, do not save changes
oBook.Close False
Set oBook = Nothing
End Sub