暱稱: joey0415
中學生
- 帖子
- 361
- 主題
- 57
- 精華
- 0
- 積分
- 426
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- 2003,2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2010-5-13
- 最後登錄
- 2022-12-8
|
回復 5# chairles59
你試試- Sub 價位更新()
- Application.ScreenUpdating = False
- Sheets(1).Activate
- rc = Cells(Rows.Count, 1).End(xlUp).Row
- For i = 3 To rc
- Range("r1:az10").ClearContents
- sn = Cells(i, 1)
- With ActiveSheet.QueryTables.Add(Connection:="URL;https://tw.stock.yahoo.com/q/q?s=" & sn, Destination:=Range("$s$1"))
- .WebFormatting = xlWebFormattingNone
- .WebTables = "4,7"
- .Refresh BackgroundQuery:=False
- .Delete
- End With
- Range("b1") = Left(Range("w1"), 10)
- Cells(i, 10) = Range("t5")
- Cells(i, 9) = Range("u5")
- Next
- Range("r1:az10").ClearContents
- Range("a1").Select
- Application.ScreenUpdating = True
- End Sub
複製代碼
股票.zip (18.68 KB)
|
|