Hi,
I have the following code which works - however, I need to be able to pass it a filename instead of hardcoding it in. Is there a way that this can be done, as it appears the name has to be static and not a variable, that is passed ?
Sheets("Review DCT File").Select
Range("A2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\chambed\Desktop\DCT\filename_20060330.csv", _
Destination:=Range("A2"))
.Name = "filename_20060339"
.FieldNames = True
ActiveCell.SpecialCells(xlLastCell).Select
Range("A2:AL161").Select
Range("AL161").Activate
Selection.ClearContents
Selection.QueryTable.Delete
Sheets("DCT Spec V0.2").Select
End Sub
Bookmarks