- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 257
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-27
|
¦^´_ 2# seemee - Sub Ӫѥæ©ö©ú²Ó¤U¸ü()
- Dim ªÑ²¼¥N¸¹ As String, ¦~ As String, ¤ë As String, N As Name, i As Integer, T As Integer, A
- ¦~ = 2013
- ¤ë = 1
- ¤ë = Format(¤ë, "00")
- ªÑ²¼¥N¸¹ = 2330
-
- T = Time
- With ActiveSheet
- .Cells.Clear
- DoEvents
- 'Application.ScreenUpdating = False
- 'Application.StatusBar = False
- With .QueryTables.Add(Connection:="URL;http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/genpage/Report" & ¦~ & ¤ë & "/" & ¦~ & ¤ë & "_F3_1_8_" & ªÑ²¼¥N¸¹ & ".php?STK_NO=" & ªÑ²¼¥N¸¹ & "&myear=" & ¦~ & "&mmon=" & ¤ë, Destination:=Range("A1"))
- .BackgroundQuery = True
- .WebTables = "8"
- .Refresh BackgroundQuery:=False
- ActiveSheet.Names(.Name).Delete
- End With
- ¤ë = 2
-
- Do
- ¤ë = Format(¤ë, "00")
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Select
- With .QueryTables.Add(Connection:="URL;http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/genpage/Report" & ¦~ & ¤ë & "/" & ¦~ & ¤ë & "_F3_1_8_" & ªÑ²¼¥N¸¹ & ".php?STK_NO=" & ªÑ²¼¥N¸¹ & "&myear=" & ¦~ & "&mmon=" & ¤ë, Destination:=Selection)
- .BackgroundQuery = True
- .WebTables = "8"
- On Error Resume Next
- Do
- Err.Clear
- .Refresh BackgroundQuery:=False
- If Err.Number = 1004 Then GoTo 10 'µLªk¶}±ÒÀÉ®×´N¸õ¨ì¤U¤@¤ë
- Loop Until Err.Number = 0
- On Error GoTo 0
- If Application.CountA(.ResultRange) = 0 Then GoTo OUT
- .ResultRange.Rows("1:2").Delete '§R°£1:2¦C
- ActiveSheet.Names(.Name).Delete
- 10
- ¤ë = ¤ë + 1
- End With
- Loop Until ¤ë > 12
- OUT:
- .[A1].Select
- Application.ScreenUpdating = True
- With .UsedRange
- .WrapText = False
- .Interior.ColorIndex = xlNone
- .Font.Size = 12
- .Columns.AutoFit
- A = CreateObject("WScript.Shell").popup("¦@¤U¸ü " & i & " ¶¶O®É " & Format(Time - T, "hh:mm¤ÀSS¬í"), 5, ¦~ & "_" & ªÑ²¼¥N¸¹, 48 + 0)
- Application.StatusBar = ¦~ & " _ " & ªÑ²¼¥N¸¹ & " ¦@¤U¸ü " & i & "¶ ¶O®É " & Format(Time - T, "HH:MM:SS")
- End With
- For Each N In .Names
- N.Delete
- Next
- End With
- End Sub
½Æ»s¥N½X |
|