Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I recorded a macro to import data from a text file. When I record i interactively, I replace data, but when I integrate this script into macro it always shoves old data over, which screws up my cel references in other formulas. How can I modify this code to replac 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 .FillAdjacentFormulas = True .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 Weisma -- bramweisma ----------------------------------------------------------------------- bramweisman's Profile: http://www.excelforum.com/member.php...nfo&userid=174 View this thread: http://www.excelforum.com/showthread.php?threadid=38577 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how replace comma with point in import data | Excel Worksheet Functions | |||
Macro to import & update rows in spreadsheet based on Ref ID. | Excel Discussion (Misc queries) | |||
Find and Replace based on neighboring cells? | Excel Discussion (Misc queries) | |||
How to import data based on a variable | Excel Worksheet Functions | |||
Macro that inserts lines | Excel Discussion (Misc queries) |