- ©«¤l
- 142
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 160
- ÂI¦W
- 70
- §@·~¨t²Î
- win10 64¦ì¤¸
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »OÆW °ª¶¯¥«
- µù¥U®É¶¡
- 2015-7-18
- ³Ì«áµn¿ý
- 2025-3-13
        
|
[µo°Ý] ½Ð°Ý¯à§_±N2ÓVBA¥¨¶°¦X¨Ö¦¨1ÓVBA¥¨¶°
¥»©«³Ì«á¥Ñ lcctno ©ó 2015-7-23 21:06 ½s¿è
§Ú¬Oªì¾ÇªÌ ºô¸ô¤W§ä¤F¼Æ¤Ñ ¦ý¤@ª½§ä¤£¨ì¤èªk ½Ð°ª¤âÌ©Ô§Ú¤@§â ÁÂÁÂ
VBA¥¨¶°.1
Sub §Y®É²bÈ()
Dim E As Object, myItems As Object, myitem
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.yuantaetfs.com/#/RtNav/Index"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
'Application.Wait Now + #12:00:01 AM# '¦³¿ù¦b¶}±Ò
Set myItems = .Document.getElementsByTagName("button")
For Each myitem In myItems
If myitem.Name = "Agree" Then
myitem.Click '«ö¤U°e¥X¬d¸ß«ö¶s
End If
Next
Application.Wait Now + #12:00:01 AM#
Set E = .Document.getElementsByTagName("TABLE")(21)
.Document.body.innerHTML = E.outerHTML
.ExecWB 17, 2 ' Select All
.ExecWB 12, 2 ' Copy selection
With ActiveSheet
'.Cells.Clear
.[A1].Select
.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
.Quit 'Ãö³¬ºô¶
End With
Range("L1:Q19").Select
Selection.ClearContents
Range("D16:D17").Select
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
End Sub
VBA¥¨¶° 2
Sub °ê¤º«ü¼Æ()
Dim E As Object, myItems As Object, myitem
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.yuantaetfs.com/#/Home/Index"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
'Application.Wait Now + #12:00:01 AM# '¦³¿ù¦b¶}±Ò
Set myItems = .Document.getElementsByTagName("button")
For Each myitem In myItems
If myitem.Name = "Agree" Then
myitem.Click '«ö¤U°e¥X¬d¸ß«ö¶s
End If
Next
Application.Wait Now + #12:00:01 AM#
Set E = .Document.getElementsByTagName("TABLE")(22)
.Document.body.innerHTML = E.outerHTML
.ExecWB 17, 2 ' Select All
.ExecWB 12, 2 ' Copy selection
With ActiveSheet
'.Cells.Clear
.[A27].Select
.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
.Quit 'Ãö³¬ºô¶
End With
Range("A39:E39").Select
Selection.ClearContents
Range("C27:C28").Select
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
End Sub |
|