Thanks for the reply,
I have tried various combinations of your formula but still cannot get it to work.
This is the macro:
Sub importc()
With ActiveSheet.QueryTables.Add(Connection:="TEXT;D
rdersc.dat", _
Destination:=Range("A408"))
.Name = "orders_360"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With
End Sub
The problem is with the line:
With ActiveSheet.QueryTables.Add(Connection:="TEXT;D
rdersc.dat", _
Destination:=Range("A408"))
I need to replace ("A408")) with the active cell.
I have managed to get over this with this:
pos = InputBox("ENTER CELL")
With ActiveSheet.QueryTables.Add(Connection:="TEXT;D
rdersg.dat", _
Destination:=Range(pos))
but this is a bit cumbersome, I am sure there must be a better way.
regards
Bob