QueryTables重複查詢,如何覆蓋上一筆查詢
- 帖子
- 16
- 主題
- 10
- 精華
- 0
- 積分
- 68
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- 2003
- 閱讀權限
- 20
- 註冊時間
- 2015-2-26
- 最後登錄
- 2021-10-4
|
QueryTables重複查詢,如何覆蓋上一筆查詢
各位大大安安
我使用QueryTable作查詢時,
每次查詢一個股價資料
就會把前一個已經查好的股價資料往旁邊擠
到最後儲存格就會用罄
我希望的是每次查詢都使用同一個範圍的儲存格,
意即把上一個查好的股價資料覆蓋(不要往旁邊擠)
我該怎麼修改呢?
程式碼如下
With ActiveSheet.QueryTables.Add(Connection:="URL;https://tw.finance.yahoo.com/q/q?s=" & stockID, Destination:=Sheets(10).Range("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "6"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
.Name = .ResultRange.Cells(3, 1)
End With |
|
|
|
|
|
|
|
- 帖子
- 16
- 主題
- 10
- 精華
- 0
- 積分
- 68
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- 2003
- 閱讀權限
- 20
- 註冊時間
- 2015-2-26
- 最後登錄
- 2021-10-4
|
|
|
|
|
|
|
|