I recorded a macro to import data from a text file. When I record it interactively, I replace data, but when I integrate this script into a macro it always shoves old data over, which screws up my cell references in other formulas. How can I modify this code to replace data instead?
Sheets(HOTPAGE).Select
Cells(8, 1).Select
' Selection.Delete Shift:=xlUp
Selection.Clear
With Sheets(HOTPAGE).QueryTables.Add(Connection:= _
"TEXT;" & HOTSAUCE, Destination:=Sheets(HOTPAGE).Cells(8, 1))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
' .TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
' .TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
Thanks a bunch,
Bram Weisman
Bookmarks