ª½±µ§ì°£®§ªí¨ì¤u§@ªí¤¤¤£¥¿±`
- ©«¤l
- 759
- ¥DÃD
- 249
- ºëµØ
- 0
- ¿n¤À
- 1021
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 11
- ³nÅ骩¥»
- OFFICE2021
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-5-30
- ³Ì«áµn¿ý
- 2024-11-26
|
ª½±µ§ì°£®§ªí¨ì¤u§@ªí¤¤¤£¥¿±`
ªÑ²¼¦WºÙ¤£¥¿±`
Sub Ä_¨Ó°£®§ªí()
Application.ScreenUpdating = False '°£Åv°£®§ªí
Application.EnableEvents = False
Application.DisplayStatusBar = False
ActiveSheet.DisplayPageBreaks = False
Dim i As Integer, S As Integer, k As Integer, j As Integer
Dim Element
With CreateObject("InternetExplorer.Application")
' .Visible = True '¥iÅã¥Üºô¶
.Navigate "http://jdata.yuanta.com.tw/z/ze/zeb/zeb.djhtm"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
Set Element = .Document.getElementsByTagName("table")
On Error Resume Next
Sheets("sheet1").Range("a:e").ClearContents
With Sheets("sheet1")
For S = 2 To 2 '¤w§ä¥Xºô¶ªºtable¤º®e¦b 0-3 ¤¤
For i = 1 To Element(S).Rows.Length - 1
k = k + 1
For j = 0 To 4 '¸ê®ÆªºÄæ¦ì¦@6¦ì
.Cells(k, j + 1) = Element(S).Rows(i).Cells(j).innerText
Next
Next
Next
End With
.Quit
End With
Set Element = Nothing
Application.DisplayStatusBar = True
End Sub
Book2.rar (20.52 KB)
|
|
|
|
|
|
|
- ©«¤l
- 75
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 371
- ÂI¦W
- 1
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2024-11-26
|
Sub Click_1()
Dim ie
Sheets(1).Select
Const url As String = "http://jdata.yuanta.com.tw/z/ze/zeb/zeb.djhtm" ' ¥¿½Tªº
Cells.Delete 'Clear
Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
With ie
.Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
.Navigate url
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop ' Do While .ReadyState <> 4 'µ¥«Ýºô¶¶}±Ò
DoEvents
' Loop
.ExecWB 17, 2 'Select All
.ExecWB 12, 2 'Copy selection
Range("A1").Activate
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
Columns("A:A").Delete ' ±N¶×¤J®É A¡BB ¨âÄæ²¾°£¡A 쥻 C:I ªºÄæ¦ì¥þ³¡¥ª¾a¡A ¦¨¬° A:I
ie.Quit
End Sub |
|
|
|
|
|
|
- ©«¤l
- 759
- ¥DÃD
- 249
- ºëµØ
- 0
- ¿n¤À
- 1021
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 11
- ³nÅ骩¥»
- OFFICE2021
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-5-30
- ³Ì«áµn¿ý
- 2024-11-26
|
Sub Click_1()
Dim ie
Sheets(1).Select
Const url As String = "http://jdata.yuanta.com.tw/z/z ...
f3202 µoªí©ó 2017-6-22 13:09
ÁÂÁ¡A§Ú¥un«e5Äæ A-E n§ï¨º¨Ç¦a¤è©O? |
|
|
|
|
|
|