0

例如,以下查询将创建一个新列A , A列中的数据现在将位于B列中

With ActiveSheet.QueryTables.Add(Connection:="URL;" & u, _
Destination:=Cells(14, 8))
    .BackgroundQuery = True
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = False
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlOverwriteCells
    .SavePassword = False
    .SaveData = True
    .RefreshPeriod = 0
    .WebSelectionType = xlEntirePage
    .WebFormatting = xlWebFormattingNone
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    .AdjustColumnWidth = False
End With

网络查询的目的地是否有可能保持固定让我们说A1

4

1 回答 1

0

是的。.RefreshStyle = xlOverwriteCells在您的 With 子句中添加。这将强制外部数据到 A1 而不是添加新列。

于 2016-02-10T22:04:31.440 回答