Excel VBA §ìHTML ¤¤ªº¬Y¤@ÓTable
- ©«¤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
        
|
¦^´_ 1# BarryHuang621a
§A´£¨Ñ´¼¼z¿ïªÑ¤u¨ãªººô§},¦b§Úªº XP, IE8 Àô¹Ò¤U°õ¦æ«ÜºC,¦³®É·|±¾±¼
½Ð¸Õ¸Õ§Oªººô§}- Option Explicit
- Sub Ex()
- Dim D As Object, i As Integer, URL As String
- URL = "http://forum.twbts.com/thread-12273-1-2.html"
- 'URL = "http://www.goodinfo.tw/stockinfo/StockSorter.asp?"
- With CreateObject("InternetExplorer.Application")
- .Navigate URL
- .Visible = True
- Do While .ReadyState <> 4 Or .Busy
- DoEvents
- Loop
-
- Set D = .document.getElementsByTagName("table")
- ActiveSheet.Cells.Clear
- For i = 0 To D.Length - 1
- Ep i, D(i).outerHTML
- Next
- .Quit
- End With
- End Sub
- Private Sub Ep(i As Integer, S As String)
- Dim R
- With CreateObject("InternetExplorer.Application")
- .Navigate "about:Tabs"
- .Visible = True
- .document.body.innerhtml = S
- .ExecWB 17, 2 ' Select All
- .ExecWB 12, 2 ' Copy selection
- With ActiveSheet
- R = IIf(.UsedRange.Rows.Count = 1, 1, .UsedRange.Rows.Count + 2)
- .Cells(R, 1) = "²Ä " & i & " Ó Table"
- .Cells(R, 1).EntireRow.Interior.Color = vbYellow
- .UsedRange.Cells(R + 1, 1).Select
- .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
- End With
- .Quit
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|