- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 6# tsuneng - Option Explicit
- Sub Ex()
- Dim Theurl As String, Sdate
- Theurl = "http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=" & Sdate & "&s=0"
- With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("b1"))
- .BackgroundQuery = True
- .RefreshStyle = xlOverwriteCells
- .RefreshPeriod = 0
- .AdjustColumnWidth = False
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- '.WebTables = "1,2,3,4"
- .WebDisableDateRecognition = True 'Ãö³¬¤é´Á¿ëÃÑ
- .Refresh BackgroundQuery:=False
- .ResultRange.Columns(1).TextToColumns Destination:=.ResultRange.Cells(1), DataType:=xlDelimited, _
- TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
- Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
- :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
- Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
- ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
- (20, 1)), TrailingMinusNumbers:=True
- 'TextToColumns ¤èªk (¸ê®ÆåªR)ªº°Ñ¼Æ¥i¿ý»s±o¨ì
- 'ResultRange.Columns(1):weby¸ê®Æªº²Ä¤@Äæ
- 'ResultRange.Cells(1) :weby¸ê®Æªº²Ä¤@ÓCells(Àx¦s®æ)
- .Delete
- End With
- End Sub
- Sub Ex1()
- Dim Theurl As String, Sdate, AR
- Sdate = "103/01/03"
- Theurl = "http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=" & Sdate & "&s=0"
- With Workbooks.Open(Theurl)
- AR = .Sheets(1).UsedRange
- .Close False
- End With
- With ActiveSheet
- .UsedRange.Clear
- .Range("A1").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
-
- End With
- End Sub
½Æ»s¥N½X |
|