¼ÐÃD:
[µo°Ý]
ºô¸ôCSV¤U¸ü°ÝÃD
[¥´¦L¥»¶]
§@ªÌ:
spermbank
®É¶¡:
2013-3-29 11:35
¼ÐÃD:
ºô¸ôCSV¤U¸ü°ÝÃD
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-3-29 20:14 ½s¿è
¤j®a¦n:
§Ú·Q±q
http://mops.twse.com.tw/mops/web/t51sb08
Â^¨ú¤W¥«101¦~²Ä4©u»P¤WÂd101¦~²Ä4©uªº©Ò¦³CSVÀÉ®×
¥i¬O°ÝÃD¨ÓÅo
¦]¬°¥«³õ§On¤À§O¿ï¤W¥«©Î¤WÂd¡A¥B¿ï¾Ü¤W¥«¤Sn¦s¨ú¦hÓCSVÀɮסF¿ï¾Ü¤WÂd¤Sn¦s¨ú¦hÓCSVÀɮסA¤~¯à¦Û¦æ¨Ö¤J¤@Óexcelªí®æ·í¤¤
©Ò¥H·Q½Ð±Ð
¦p¦ó"¤@¦¸"±N¤W¥«¤Î¤WÂdªºCSV¤@¦¸¶×¤J¤@Óexcelªí®æ·í¤¤©O?
ÁÂÁÂ
§@ªÌ:
GBKEE
®É¶¡:
2013-3-29 20:14
¼ÐÃD:
RE: ºô¸ôCSV¤U¸ü°ÝÃD
¦^´_
1#
spermbank
³oì©lÀɮפ¤§ä¤£¨ìCSVÀɮתººô§}¥i¤U¸ü!!
¸Õ¸Õ¬Ý (¥i¸ÕµÛקï¤U¸ü¤W¥«,¤WÂdªº¸ê®Æ)
Option Explicit
Sub ¤½¶}¸ê°TÆ[´ú¯¸()
Dim Ie As Object, xx, k, j, i, AA As Variant
Dim T As Date
ActiveSheet.Cells.Clear
Application.DisplayStatusBar = True
On Error GoTo ie_err
Set Ie = CreateObject("InternetExplorer.Application")
Ie.Navigate "http://mops.twse.com.tw/mops/web/t51sb08"
Ie.Visible = True
Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
'********** קï³o¸Ì ªº¿ï¶µ
Ie.Document.ALL(632).Value = "sii" '¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
Ie.Document.ALL(643).Value = "101" '¦~«×
Ie.Document.ALL(650).Value = "04" '²Ä¤@©u = 01,²Ä¤G©u = 02,²Ä¤T©u = 03,²Ä¥|©u = 04
Ie.Document.ALL(667).Click
Ie.Visible = False
ºô¶¾ã²z
Set AA = Ie.Document.getelementsbytagname("table") '¸ê®Æ°Ï
' Ie.Quit
T = Time
Application.ScreenUpdating = False
With ActiveSheet
On Error Resume Next
For xx = 13 To AA.Length - 1
For i = 0 To AA(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
k = k + 1
For j = 0 To 19
.Cells(k, 1).Select
Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
.Cells(k, j + 1) = AA(xx).Rows(i).Cells(j).innertext
Next
Next
Next
Set AA = .Range("S2:S" & .[S2].End(xlDown).Row)
AA.Replace "°ò¥»¨CªÑ¬Õ¾l", "", xlWhole
AA.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
.Cells(.Rows.Count, 1).End(xlUp).EntireRow.Delete
ActiveWindow.ScrollRow = .Cells(.Rows.Count, 1).End(xlUp).Row - 20
.Cells(.Rows.Count, 1).End(xlUp).Select
End With
Application.ScreenUpdating = True
'Ie.Quit
Application.StatusBar = "¤U¸ü¸ê®Æ®É¶¡ : " & Format(Time - T, ["S¬í"])
End
ie_err:
MsgBox "ºô¶¦³°ÝÃD,½Ð«·s°õ¦æ..."
Set Ie = Nothing
End Sub
Private Sub ºô¶¾ã²z() 'µ¥«Ýºô¶¤U¸ü¸ê®Æ§¹²¦ªº®É¶¡
Dim Tt(1 To 3) As Date
Tt(1) = Time
Tt(2) = Time
Tt(3) = #12:00:10 AM# '10¬í ½Õ¾ã³o¸Ì
Do
If Time > Tt(2) Then
Application.StatusBar = "ºô¶¤U¸ü¤¤ ³Ñ¾l¬í¼Æ.. " & Second(Tt(1) + Tt(3) - Time)
Tt(2) = Time
End If
DoEvents
Loop Until Time > Tt(1) + Tt(3)
Application.StatusBar = "¸ê®Æ¤U¸ü¤¤...."
End Sub
½Æ»s¥N½X
§@ªÌ:
spermbank
®É¶¡:
2013-3-30 00:56
¥»©«³Ì«á¥Ñ spermbank ©ó 2013-3-30 00:58 ½s¿è
¦^´_
2#
GBKEE
·l¯qªí¤W¥«¤Î¤WÂd¥i¥HC¡A¤Q¤À·PÁ¤j¤j
¥t¥~§Ú§âºô§}§ï¦¨http://mops.twse.com.tw/mops/web/t51sb13 Ū¨ú¦X¨Ö·l¯qªí
§Úµo²{«o¤S¤£¦æÅo¡A¤£ª¾¹Dn¦p¦ó׸Ó?
Yºô¸ô¸ê®Æ·|³°Äò¼W¥[µ§¼Æ¡A¬O§_»Ýn¦Û¦æ§ó·s§PÂ_µ§¼Æ©O?
ÁÂÁÂ
§@ªÌ:
GBKEE
®É¶¡:
2013-3-30 09:03
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-3-30 16:06 ½s¿è
¦^´_
3#
spermbank
³oºô¶¦³×§ï±±¨î¶µ,2# ³o¨Çµ{¦¡½X¤£¾A¥Î, 4#ªºµ{¦¡½X¤wקאּ¥¿½T
Ie.Document.ALL(632).Value = "sii" '¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
Ie.Document.ALL(643).Value = "101" '¦~«×
Ie.Document.ALL(650).Value = "04" '²Ä¤@©u = 01,²Ä¤G©u = 02,²Ä¤T©u = 03,²Ä¥|©u = 04
Ie.Document.ALL(667).Click
½Æ»s¥N½X
¨C¤@ºô¶ªºªí³æ«Ø¸m¤£¤@¼Ë,»Ý¤@¤@¥h´M§ä
Option Explicit
Sub ¤½¶}¸ê°TÆ[´ú¯¸()
Dim ie As Object, xx, k, j, i, AA As Variant
Dim T As Date, ¸ê°T As String
Do
¸ê°T = InputBox("1: ·l¯qªí" & vbLf & "2: ¦X¨Ö·l¯qªí") '¿ï¾Ü¤½¶}¸ê°TÆ[´ú¯¸ªºªí®æ
'¸ê°T = InputBox("1: ·l¯qªí" & vbLf & "2: ¦X¨Ö·l¯qªí"& vbLf & "3: ???ªí"...............)
If ¸ê°T = "" Then Exit Sub '¤£¿ï¾Üµ²§ôµ{¦¡
Loop Until Val(¸ê°T) > 0 And Val(¸ê°T) <= 2 ' Val(¸ê°T)<=??? µ²§ô¿ï¾Üªí³æ
ActiveSheet.Cells.Clear
Application.DisplayStatusBar = True
Application.StatusBar = "....... ºô¶¶}±Ò¤¤.......... "
' On Error GoTo ie_err
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate ¤U¸üºô§}(¸ê°T)
Do While ie.Busy Or ie.ReadyState <> 4
DoEvents
Loop
With ie.Document
T = Time
Do While ie.Busy Or ie.ReadyState <> 4
If Time = T + #12:01:00 AM# Then GoTo ie_err 'µ¥Ôºô¶²§±`:µ²§ôµ{¦¡
DoEvents
Loop
'********** קï³o¸Ì ªº¿ï¶µ
.getelementbyID("TYPEK").Value = "sii" '¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
.getelementbyID("year").Value = "101" '¦~«×
.getelementbyID("season").Value = "02" '²Ä¤@©u = 01,²Ä¤G©u = 02,²Ä¤T©u = 03,²Ä¥|©u = 04
For i = 0 To .getelementsbytagname("input").Length - 1
If .getelementsbytagname("input")(i).Type = "button" And .getelementsbytagname("input")(i).Value = " ·j´M " Then
.getelementsbytagname("input")(i).Click
End If
Next
µ¥«Ýºô¶
Set AA = .getelementsbytagname("table") '¸ê®Æ°Ï
End With
T = Time
With ActiveSheet
.Cells(1, "A") = IIf(¸ê°T = 1, "·l¯qªí", "¦X¨Ö·l¯qªí")
.Cells(1, "B") = ¥«³õ§O(ie.Document.getelementbyID("TYPEK").Value)
.Cells(1, "C") = ie.Document.getelementbyID("year").Value & "¦~«×"
.Cells(1, "D") = ie.Document.getelementbyID("season").Value & "©u"
.Cells(1).Select
Application.ScreenUpdating = False
k = 1
On Error Resume Next
For xx = ºô¶ªí®æ(¸ê°T) To AA.Length - 1
For i = 0 To AA(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
k = k + 1
For j = 0 To 19
Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
.Cells(k, j + 1) = AA(xx).Rows(i).Cells(j).innertext
Next
Next
Next
Set AA = .Range("S3:S" & .[S3].End(xlDown).Row)
AA.Replace "°ò¥»¨CªÑ¬Õ¾l", "", xlWhole
AA.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
.Cells(.Rows.Count, 1).End(xlUp).EntireRow.Delete
.Cells.EntireColumn.AutoFit
.[A1].Select
End With
Application.ScreenUpdating = True
ie.Quit
Application.StatusBar = "¤U¸ü¸ê®Æ®É¶¡ : " & Format(Time - T, ["S¬í"])
End
ie_err:
ie.Quit
MsgBox "ºô¶¦³°ÝÃD,½Ð«·s°õ¦æ..."
End
¸ê°T_Err:
End Sub
Private Sub µ¥«Ýºô¶() 'µ¥«Ýºô¶¤U¸ü¸ê®Æ§¹²¦ªº®É¶¡
Dim Tt(1 To 3) As Date
Tt(1) = Time
Tt(2) = Time
Tt(3) = #12:00:10 AM# '10¬í ½Õ¾ã³o¸Ì
Do
If Time > Tt(2) Then
Application.StatusBar = "ºô¶¤U¸ü¤¤ ³Ñ¾l¬í¼Æ.. " & Second(Tt(1) + Tt(3) - Time)
Tt(2) = Time
End If
DoEvents
Loop Until Time > Tt(1) + Tt(3)
Application.StatusBar = "¸ê®Æ¤U¸ü¤¤...."
End Sub
Private Function ¤U¸üºô§}(xWord As String) As String '¶Ç¦^¿ï¾Üªººô§}
Select Case xWord
Case "1"
¤U¸üºô§} = "http://mops.twse.com.tw/mops/web/t51sb08" '·l¯qªí
Case "2"
¤U¸üºô§} = "http://mops.twse.com.tw/mops/web/t51sb13" '¦X¨Ö·l¯qªí
''Case "3" ·sºô¶ªººô§}
''
''
End Select
End Function
Private Function ¥«³õ§O(xWord As String) As String
'¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
Select Case xWord
Case "sii"
¥«³õ§O = "¤W¥«"
Case "otc"
¥«³õ§O = "¤WÂd"
Case "rotc"
¥«³õ§O = "¿³Âd"
Case "pub"
¥«³õ§O = "¤½¶}µo¦æ"
End Select
End Function
Private Function ºô¶ªí®æ(xWord As String) As Integer
Select Case xWord
Case "1"
ºô¶ªí®æ = 13 '·l¯qªí
Case "2"
ºô¶ªí®æ = 12 '¦X¨Ö·l¯qªí
''¨C¤@ºô¶ªºªí³æ«Ø¸m¤£¤@¼Ë,»Ý¤@¤@¥h´M§ä
'' ¦Û¦æ¬d¬Ý·s¼W Case "3"......
''
End Select
End Function
½Æ»s¥N½X
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-30 22:45
¦^´_
4#
GBKEE
ºô¶ªí®æ = 13 '·l¯qªí
ºô¶ªí®æ = 12 '¦X¨Ö·l¯qªí
½Ð°Ý13»P12¼Æ¾Ú¥Ñ¨Ó
Y´«¦¨¤£¦Pªí®æ§Ú¸Ón¦p¦ó§PÂ_³o¼ÆÈ?!
¨Ò¦p:http://mops.twse.com.tw/mops/web/t56sb21_q3
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-30 23:04
¤£³]ªí®æ¦WºÙ(©ïÀY),¥H¤U¬Oקﳡ¤À¸ê®ÆÀ³¥Î
±æ½Ð×¥¿¿ù»~,ÁÂÁÂ..^___^..
Option Explicit
Sub ¥Ó³øÂàÅý()
Dim ie As Object, xx, k, j, i, AA As Variant
Dim T As Date, ¸ê°T As String
Do
¸ê°T = InputBox("1: ¾ú¥v«ùªÑÂàÅý" & vbLf & "2: ¦X¨Ö·l¯qªí") '¿ï¾Ü¤½¶}¸ê°TÆ[´ú¯¸ªºªí®æ
If ¸ê°T = "" Then Exit Sub '¤£¿ï¾Üµ²§ôµ{¦¡
Loop Until Val(¸ê°T) > 0 And Val(¸ê°T) <= 2 ' Val(¸ê°T)<=??? µ²§ô¿ï¾Üªí³æ
ActiveSheet.Cells.Clear
Application.DisplayStatusBar = True
Application.StatusBar = "....... ºô¶¶}±Ò¤¤.......... "
'On Error GoTo ie_err
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate ¤U¸üºô§}(¸ê°T)
Do While ie.Busy Or ie.ReadyState <> 4
DoEvents
Loop
With ie.Document
T = Time
Do While ie.Busy Or ie.ReadyState <> 4
If Time = T + #12:01:00 AM# Then GoTo ie_err 'µ¥Ôºô¶²§±`:µ²§ôµ{¦¡
DoEvents
Loop
'********** קï³o¸Ì ªº¿ï¶µ
'http://mops.twse.com.tw/mops/web/t56sb21_q3?&step=0&firstin=1&off=1&TYPEK=sii&year=91&smonth=07&emonth=09
.getelementbyID("TYPEK").Value = "sii" '¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
.getelementbyID("year").Value = "91" '¦~«×
.getelementbyID("smonth").Value = "07" '°_¤ë¥÷
.getelementbyID("emonth").Value = "09" '°W¤ë¥÷
For i = 0 To .getelementsbytagname("input").Length - 1
If .getelementsbytagname("input")(i).Type = "button" And .getelementsbytagname("input")(i).Value = " ·j´M " Then
.getelementsbytagname("input")(i).Click
End If
Next
µ¥«Ýºô¶
Set AA = .getelementsbytagname("table") '¸ê®Æ°Ï
End With
T = Time
With ActiveSheet
.Cells(1).Select
Application.ScreenUpdating = False
k = 1
On Error Resume Next
For xx = ºô¶ªí®æ(¸ê°T) To AA.Length - 1
For i = 0 To AA(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
k = k + 1
For j = 0 To 19
Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
.Cells(k, j + 1) = AA(xx).Rows(i).Cells(j).innertext
Next
Next
Next
Set AA = .Range("R3:R" & .[R3].End(xlDown).Row)
AA.Replace "¬O§_¥Ó³ø«ù", "", xlWhole
AA.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
.Cells(.Rows.Count, 1).End(xlUp).EntireRow.Delete
.Cells.EntireColumn.AutoFit
.[A1].Select
End With
Application.ScreenUpdating = True
ie.Quit
Application.StatusBar = "¤U¸ü¸ê®Æ®É¶¡ : " & Format(Time - T, ["S¬í"])
End
ie_err:
ie.Quit
MsgBox "ºô¶¦³°ÝÃD,½Ð«·s°õ¦æ..."
End
¸ê°T_Err:
End Sub
Private Sub µ¥«Ýºô¶() 'µ¥«Ýºô¶¤U¸ü¸ê®Æ§¹²¦ªº®É¶¡
Dim Tt(1 To 3) As Date
Tt(1) = Time
Tt(2) = Time
Tt(3) = #12:00:10 AM# '10¬í ½Õ¾ã³o¸Ì
Do
If Time > Tt(2) Then
Application.StatusBar = "ºô¶¤U¸ü¤¤ ³Ñ¾l¬í¼Æ.. " & Second(Tt(1) + Tt(3) - Time)
Tt(2) = Time
End If
DoEvents
Loop Until Time > Tt(1) + Tt(3)
Application.StatusBar = "¸ê®Æ¤U¸ü¤¤...."
End Sub
Private Function ¤U¸üºô§}(xWord As String) As String '¶Ç¦^¿ï¾Üªººô§}
Select Case xWord
Case "1"
¤U¸üºô§} = "http://mops.twse.com.tw/mops/web/t56sb21_q3" '¾ú¥v«ùªÑÂàÅý
Case "2"
¤U¸üºô§} = "http://mops.twse.com.tw/mops/web/t51sb13" '¦X¨Ö·l¯qªí
''Case "3" ·sºô¶ªººô§}
''
''
End Select
End Function
Private Function ¥«³õ§O(xWord As String) As String
'¤W¥« = sii,¤WÂd = otc,¿³Âd = rotc,¤½¶}µo¦æ = pub
Select Case xWord
Case "sii"
¥«³õ§O = "¤W¥«"
Case "otc"
¥«³õ§O = "¤WÂd"
Case "rotc"
¥«³õ§O = "¿³Âd"
Case "pub"
¥«³õ§O = "¤½¶}µo¦æ"
End Select
End Function
Private Function ºô¶ªí®æ(xWord As String) As Integer
Select Case xWord
Case "1"
ºô¶ªí®æ = 11
Case "2"
ºô¶ªí®æ = 12 '¦X¨Ö·l¯qªí
''¨C¤@ºô¶ªºªí³æ«Ø¸m¤£¤@¼Ë,»Ý¤@¤@¥h´M§ä
'' ¦Û¦æ¬d¬Ý·s¼W Case "3"......
''
End Select
End Function
½Æ»s¥N½X
§@ªÌ:
diabo
®É¶¡:
2013-3-30 23:19
¦^´_
1#
spermbank
«Øij±q¸ÑªRì©l¸ê®Æºô§}µÛ¤â¡AY¸Óºô¶ª©±³]pÅܧó¡Aµ{¦¡½X¤£»Ýקï¡A¤ñ¸û¤£®e©ö¨ü¨ì¼vÅT¡Cµ{¦¡½X¥Î¿ýªº(WEB¬d¸ß-Querytable)´N¥i¥H¨ú±o.....´N¤£¼g¤F....
¹ê¬IIFRS¤§«e[101¦~²Ä4©u(§t)¥H«e]
Ó§O·l¯qªí
http://mops.twse.com.tw/mops/web/ajax_t51sb08?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=sii&year=101&season=04
Ó§O¸ê²£t¶Åªí
http://mops.twse.com.tw/mops/web/ajax_t51sb07?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=sii&year=101&season=04
¦X¨Ö·l¯qªí
http://mops.twse.com.tw/mops/web/ajax_t51sb13?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=sii&year=101&season=04
¦X¨Ö¸ê²£t¶Åªí
http://mops.twse.com.tw/mops/web/ajax_t51sb12?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=sii&year=101&season=04
¤W¥« TYPEK=sii
¤WÂd TYPEK=otc
year = ¥Á°ê¦~, ¨Ò 102
season = ©u«×, ¨Ò 01, 02, 03, 04
§@ªÌ:
diabo
®É¶¡:
2013-3-30 23:21
¦^´_
5#
HSIEN6001
¦P¤W¤@½g¦^ÂСA²¤Æ°ÝÃD±q·½ÀY¶}©l....
http://mops.twse.com.tw/mops/web/ajax_t56sb21?encodeURIComponent=1&run=Y&step=1&TYPEK=sii&year=102&smonth=01&emonth=03&sstep=1&firstin=true
§@ªÌ:
diabo
®É¶¡:
2013-3-31 00:09
¦^´_
1#
spermbank
Sub §ì°]³ø(°]³ø§O, ¥«³õ§O, ¦~, ©u)
Select Case °]³ø§O
Case "·l¯q": µ{¦¡ = "ajax_t51sb08"
Case "¸ê²£": µ{¦¡ = "ajax_t51sb07"
Case "¦X¨Ö·l¯q": µ{¦¡ = "ajax_t51sb13"
Case "¦X¨Ö¸ê²£": µ{¦¡ = "ajax_t51sb12"
End Select
Select Case ¥«³õ§O
Case "¤W¥«": ¥«³õ = "sii"
Case "¤WÂd": ¥«³õ = "otc"
Case "¿³Âd": ¥«³õ = "rotc"
Case "¤½¶}": ¥«³õ = "pub"
End Select
'ì©lºô§} http://mops.twse.com.tw/mops/web/ajax_t51sb07?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=sii&year=101&season=04
theURL = "http://mops.twse.com.tw/mops/web/" & µ{¦¡ & "?encodeURIComponent=1&step=1&firstin=1&off=1&TYPEK=" & ¥«³õ & "&year=" & ¦~ & "&season=" & ©u
With ActiveSheet.QueryTables.Add(Connection:="URL;" & theURL, Destination:=Range("A1"))
.Name = "§ì°]³ø"
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
.Delete
End With
End Sub
½Æ»s¥N½X
1. ¥H¤Wµ{¦¡½X¶È§ì¸ê®Æ¡A¨Ã¥¼³B²zª÷¿Ä«OÀIÃÒ¨é...ÃþªÑ·|p¬ì¥Ø¤£¦Pªº°ÝÃD
2. ¨Ï¥Î½d¨Ò call §ì°]³ø( "·l¯q","¤WÂd",101,"04")
§@ªÌ:
spermbank
®É¶¡:
2013-3-31 01:50
¦^´_
4#
GBKEE
G¤j±z¦n:
¤Q¤À·PÁ¤j¤jªº«ü±Ð¡A¸U¤À·P®¦¡A¦pªG¨S¦³¤j¤jªºÀ°¦£¡A§Úªºµ{¦¡¯uªº¤£ª¾¹D¦p¦ó¯à«e¶i
±q¥h¦~¥H¨Ó¡A§Ú³°Äò§Ú¦³«Ü¦h°ÝÃD¡A³£¬OG¤jªº¼ö¤ßÀ°¦£¡A§Úªº·Qªk¡A¤~¯àÂǥѵ{¦¡ºCºC°Â¥X·QnªºªF¦è
¯uªº¤Q¤À·P¿E
¤£¹LÁÙ¬O¦³´XÓ°ÝÃD·Q°Ý ><"
ºô¶ªí®æ = 11
ºô¶ªí®æ = 12 '¦X¨Ö·l¯qªí
''¨C¤@ºô¶ªºªí³æ«Ø¸m¤£¤@¼Ë,»Ý¤@¤@¥h´M§ä
'' ¦Û¦æ¬d¬Ý·s¼W Case "3"......
½Ð°Ý¼Æ¦r11»P12n¦p¦ó´M§ä?
¥t¥~¨âÓºô¶§Ú¤]·QŪ¤J
http://mops.twse.com.tw/mops/web/t21sc04 '¨C¤ëÀç·~¦¬¤J²Îp·JÁ`ªí¡A "¦¹ºô¶·|¸õ¥X¥t¤@ºô¶"
http://mops.twse.com.tw/mops/web/t21sb06 '¨C¤ë¦X¨ÖÀç·~¦¬¤J²Îp·JÁ`ªí
§Ú¤Sn¦p¦ó¶×¤J©O? ÁÂÁ¡C
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-31 08:36
¦^´_
8#
diabo
ÁÂÁÂ,³oUR¸Õ¹L¤F,¥i±¤§ì¤U¨Ó¤å¦r¬O¶Ã½X
G¤jªº´ú¸ÕOK,¦ýÁÙ¦³³\¦h¤£À´,µ¥«Ý«üÂI ^__^
§@ªÌ:
diabo
®É¶¡:
2013-3-31 09:56
¦^´_
11#
HSIEN6001
À˵øIEªº½s½X¡A¬O§_¿ï¾Ü¡u¦Û°Ê½s½X¡v......
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-31 16:47
¦^´_
12#
diabo
¤£À´C!
¦]¬°¸ÓURª½±µÅã¥Ü¶Ã½X,©Ò¥H§Ú¤U¸ü¤]¬O¶Ã½X
½Ð°Ý±z»¡ªº¬O±Nµ{¦¡½X¼g¦bVBAùØÀY±Æ°£¶Ã½X°ÝÃD?!
¥i§_¥Ü½d?!
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-31 16:56
¦^´_
4#
GBKEE
G¤j,¦P#5 ¤Î #10¤§°ÝÃD
ºô¶ªí®æ = 13 '·l¯qªí
ºô¶ªí®æ = 12 '¦X¨Ö·l¯qªí
¥i§_½Ð°Ý13»P12¼Æ¾ÚÀ³¸Ó¦p¦ó§PÂ_³o¼ÆÈ?!
¨Ò¦p:http://mops.twse.com.tw/mops/web/t56sb21_q3
§@ªÌ:
GBKEE
®É¶¡:
2013-3-31 17:09
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-3-31 18:38 ½s¿è
¦^´_
13#
HSIEN6001
§R±¼ encodeURIComponent=1
¦^´_
14#
HSIEN6001
¦³
diabo
´£¨Ñªººô§}¦n¿ì¨Ç
Option Explicit
Sub Ex()
Dim ie As Object, aa As Object, k As Integer, xx As Integer, i As Integer, j As Integer
ActiveSheet.Cells.Clear
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "http://mops.twse.com.tw/mops/web/ajax_t51sb13?step=1&firstin=1&off=1&TYPEK=sii&year=100&season=04"
Do While ie.Busy Or ie.ReadyState <> 4: DoEvents: Loop
On Error Resume Next
Set aa = ie.Document.getelementsbytagname("table") 'ªí®æ¸ê®Æ°Ï
k = 1
On Error Resume Next
For xx = 0 To aa.Length - 1
'§ä¨ì«áקï For xx = ??? To aa.Length - 1
For i = 0 To aa(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
Cells(k, 1) = "Table" & xx
k = k + 1 '¦C¼Æ
For j = 0 To 19
Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
Cells(k, j + 2) = aa(xx).Rows(i).Cells(j).innertext
Next
Next
Next
ie.Quit
End Sub
½Æ»s¥N½X
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-31 19:44
¦^´_
15#
GBKEE
¥H102¦~1~3¤ë¬°¨Ò¡A¤W¥«sii¤Î¤WÂdotc:
ºô§}¬O¡G
http://mops.twse.com.tw/mops/web/ajax_t56sb21?&run=&step=1&TYPEK=sii&year=102&smonth=01&emonth=03&sstep=1&firstin=true ¡¥¤W¥« sii ¤WÂd otc
¦]¬°¤U¸ü¤§«á§e²{¶Ã½X¡A©Ò¥H¤~¥ÎG¤j#4ªº¤è¦¡
®M¥ÎUR : http://mops.twse.com.tw/mops/web/t56sb21_q3?&step=0&firstin=1&off=1&TYPEK=sii&year=102&smonth=01&emonth=03 ¡¥¤W¥« sii ¤WÂd otc
´ú¸Õ§¹¾ã¥N½X©ó#6 ¡A´ú¸ÕOK ªº (¨S¶Ã½X)
¥u¬O¨Sªk²z¸Ñ----->ºô¶ªí®æ 13 or 12
¹J¨ì¤£¦Pºô¶¡A§P§O¤è¦¡¡H¡I
PS¡Gèè¸Õ #15 ªº¥N½X¡A¤U¸ü¤]§e²{¶Ã½X¡C
§@ªÌ:
HSIEN6001
®É¶¡:
2013-3-31 19:57
¤£¦n·N«ä,¸É¥R»¡©ú¤@¤U
#16 ¨âÓURL ³£¬O«ü¦P¤@¥÷ªí®æ
§@ªÌ:
diabo
®É¶¡:
2013-3-31 21:54
¦^´_
13#
HSIEN6001
1. EXCELªºWEB¬d¸ß¡A¤]¬O³z¹LIE¡A¦]¦¹IEªº³]©w·|¼vÅT¨ì¤U¸üªºµ²ªG¡C
2. IE À˵ø¡÷½s½X¡÷¦Û°Ê¿ï¨ú
[attach]14500[/attach]
§@ªÌ:
GBKEE
®É¶¡:
2013-4-1 15:18
¦^´_
16#
HSIEN6001
¥u¬O¨Sªk²z¸Ñ----->ºô¶ªí®æ 13 or 12 ¹J¨ì¤£¦Pºô¶¡A§P§O¤è¦¡¡H¡I
4# ³o¬qµ{¦¡½X
k = 1
47. On Error Resume Next
48. For xx = ºô¶ªí®æ(¸ê°T) To AA.Length - 1
49. For i = 0 To AA(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
50. k = k + 1
51. For j = 0 To 19
52. Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
53. .Cells(k, j + 1) = AA(xx).Rows(i).Cells(j).innertext
54. Next
55. Next
56. Next
½Æ»s¥N½X
§ï¦¨15#³o¬qµ{¦¡½X
10. k = 1
11. On Error Resume Next
12. For xx = 0 To aa.Length - 1
13. '¤£¦Pºô¶¡A§P§O¤è¦¡ '§ä¨ì«áקï For xx = ??? To aa.Length - 1
14. For i = 0 To aa(xx).Rows.Length - 1 '¼g¤J¸ê®Æ
15. Cells(k, 1) = "Table" & xx
16. k = k + 1 '¦C¼Æ
17. For j = 0 To 19
18. Application.StatusBar = "¤U¸ü¸ê®Æ¤¤ ..." & k - 1
19. Cells(k, j + 2) = aa(xx).Rows(i).Cells(j).innertext
20. Next
21. Next
22. Next
½Æ»s¥N½X
§@ªÌ:
HSIEN6001
®É¶¡:
2013-4-2 00:11
¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2013-4-2 00:13 ½s¿è
¦^´_
19#
GBKEE
¦^´_
18#
diabo
ÁÂÁ¨â¦ìÀ°¦£¸Ñ´b
§A̳£¦n´Î³á!
·P®¦ ^__^
§@ªÌ:
tsuneng
®É¶¡:
2013-4-21 18:06
·P®¦¤j¤j¤À¨É.
§@ªÌ:
randomwalk
®É¶¡:
2013-5-17 11:18
¦^´_
8#
diabo
½Ð±Ðdiabo¥S
¦p¦óÀ˵øì©lºô§}?
·sª©ªº¤½¶}¸ê°T¯¸¨ÃµLªkÀ˵ø,
±æ¤£§[«ü¾É,ÁÂÁÂ
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)