§ó·sªÑ¥«¨C¤é½L«á¦æ±¡³Ì·s¸ê®Æ
- ©«¤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
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-3 07:21 ½s¿è
¦^´_ 3# gelai01000001 - Option Explicit
- Sub ¤U¸üºô¯¸¸ê®Æ()
- Dim Startmonth As String, Startday As String, xDate As Date, Msg As Boolean, Sh As Worksheet
- Dim T As Date
- T = Time
- On Error Resume Next 'µ{¦¡°õ¦æ¤¤¦³¿ù»~®É,¤£¸Ì·|Ä~Äò°õ¦æµ{¦¡
- xDate = Date '·í¤é
- '***************´ú¸Õ¥Î
- xDate = #9/8/2013# '¥ð¥«¤é
- '***************´ú¸ÕµL»~«á¥i§R°£±¼
- Set Sh = ActiveSheet '«ü©w¤u§@ªí:¦¹µ{¦¡¦b¥ô¦ó¼Ò²Õ¤¤¬Ò¥i¥Î
- EX:
- If Err.Number <> 0 Or Msg = True Then '·í¤é(©|¥¼¦³¸ê®Æ:¿ù»~) ©Î ¥ð¥«
- xDate = xDate - 1 '©¹«á°h¤@¤é
- Err.Clear
- Msg = False
- End If
- Sh.UsedRange.Clear '²M²z¤u§@ªí¤w¨Ï¥Îªº½d³ò
- Startday = Format(xDate, "YYYYMMDD")
- Startmonth = Format(xDate, "YYYYMM")
- '¤U¸üºô¯¸ªººô§}
- With Sh.QueryTables.Add(Connection:="URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Startmonth & "/A112" & Startday & "ALLBUT0999_1.php?select2=ALLBUT0999&chk_date=" & Format(xDate, "E/MM/DD"), Destination:=Range("A3"))
- .RefreshStyle = xlOverwriteCells '§ì¨úºô¶ªº²Ä10Óªí®æ§@¬°¶×¤J¸ê®Æ
- .WebTables = "10"
- .Refresh BackgroundQuery:=False '·í¤é(©|¥¼¦³¸ê®Æ:¿ù»~)
- If Err.Number <> 0 Then GoTo EX
- If Application.CountA(Sh.QueryTables(1).ResultRange) = 0 Then '¥ð¥« ¨S¦³¸ê®Æ
- Msg = True
- GoTo EX
- End If
- End With
- With Sh.UsedRange
- .Font.Size = 12
- .EntireColumn.AutoFit
- End With
- MsgBox "¥æ©öªº³Ì·s¤é´Á " & xDate & vbLf & Application.Text(Time - T, "¶O®É [SS] ¬í")
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|