- 帖子
- 472
- 主題
- 5
- 精華
- 0
- 積分
- 485
- 點名
- 0
- 作業系統
- Windows
- 軟體版本
- MS Office
- 閱讀權限
- 100
- 性別
- 男
- 來自
- 香港
- 註冊時間
- 2010-7-4
- 最後登錄
- 2014-12-28

|
你可以試試一句一句試試了解一下意思- Sub GetTransInfo()
- Worksheets("sheet2").Activate
- Call 券商進出("2885", "sheet2", "A1")
- 'Call 券商進出("2409", "sheet2", "A60")
- End Sub
- Sub 券商進出(stock As String, tsheet As String, tcell As String)
- '"all&stockid",
- Call 券商進出2("8,10,11", stock, tsheet, tcell)
- End Sub
- '(all&stockid,
- Sub 券商進出2(tbl As String, stock As String, tsheet As String, tcell As String)
- With Worksheets(tsheet).QueryTables.Add(Connection:="URL;http://yamstock.megatime.com.tw/asp/stockinfo/ps_top.asp?m=all&stockid=" & _
- stock & "&name1=D2&index1=6", _
- Destination:=Worksheets(tsheet).Range(tcell))
- .Name = all & "_" & stock
- .FieldNames = True
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .BackgroundQuery = False
- .RefreshStyle = xlOverwriteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = tbl
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
- End Sub
複製代碼 |
|