§ó·sªÑ¥«¨C¤é½L«á¦æ±¡³Ì·s¸ê®Æ
- ©«¤l
- 13
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 23
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- Office 2002
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2012-12-25
- ³Ì«áµn¿ý
- 2013-11-6
|
§ó·sªÑ¥«¨C¤é½L«á¦æ±¡³Ì·s¸ê®Æ
"¦pªGªÑ¥«·í¤Ñ¥ð¥«¡A¥i¦Û°Ê§ó·s¦³¥æ©öªº³Ì·s¤é´Á"??½Ð°Ý¦p¦óקïµ{¦¡
Sub ¤U¸üºô¯¸¸ê®Æ()
With Range(Cells(3, 1), Cells(1000, 16))
.Clear
.Delete
End With
Dim ptxt As String
Startday = Left(Date, 4) & "0" & Mid(Date, 6, 1) & Right(Date, 2) "¦pªGªÑ¥«·í¤Ñ¥ð¥«¡A¥i¦Û°Ê§ó·s¦³¥æ©öªº³Ì·s¤é´Á"??½Ð°Ý¦p¦óקïµ{¦¡
Startmonth = Left(Date, 4) & "0" & Mid(Date, 6, 1)
'¤U¸üºô¯¸ªººô§}
With ActiveSheet.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=" & Startday, Destination:=Range("A3"))
' xlOverwriteCells ªí¥ÜÂл\Äæ¦ì
.RefreshStyle = xlOverwriteCells
' §ì¨úºô¶ªº²Ä10Óªí®æ§@¬°¶×¤J¸ê®Æ
.WebTables = "10"
.Refresh BackgroundQuery:=False
End With
'±NR2C1:R878C16½d³òªºÀx¦s®æ¦r§Î½Õ¾ã¬°12
Cells.Select
Cells.Font.Size = 12
End Sub
·Ð½Ð¦U¦ì°ª¤â±M®a¸Ñ´b¡AÁÂÁÂ! |
|
|
|
|
|
|
- ©«¤l
- 13
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 23
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- Office 2002
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2012-12-25
- ³Ì«áµn¿ý
- 2013-11-6
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-6 07:26 ½s¿è
¦^´_ 7# GBKEE
GBKEE·PÁ§A³o»ò¼ö¤ß©âªÅ«ü¾É¸Ñ´b!
¥á°Õ!³o¤~¬O§Ú·Qªü£z£°!2013¬K¸`¥ð°²9¤Ñ¤]¥i¥H©O! |
|
|
|
|
|
|
- ©«¤l
- 13
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 23
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- Office 2002
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2012-12-25
- ³Ì«áµn¿ý
- 2013-11-6
|
§Ú±Ndateªº¤é´Á§ï¬°¬P´Á¤Ñªº¤é´Á¡Aµ{¦¡·|µL¤îÀRªº¶]¦^°é?
½Ð°ÝGBKEE¶W¯Åª©¥D¡A°²¦p§Ú§ó·sªº¤é´Á(Date)¶ZÂ÷ªÑ¥«³Ì«á¥æ©ö¤é¶W¹L1¤Ñ¥H¤W¡A¤S¸Ó¦p¦óקï©O?·PÁ«ü¾É- Sub ¤U¸üºô¯¸¸ê®Æ()
- Dim Startmonth As String, Startday As String, xDate As Date, Msg As Boolean, Sh As Worksheet
- On Error GoTo EX 'µ{¦¡°õ¦æ¤¤¦³¿ù»~®É¸õ¨ì EX: Ä~Äò°õ¦æµ{¦¡
- xDate = Date '·í¤é
- Set Sh = ActiveSheet '«ü©w¤u§@ªí:¦¹µ{¦¡¦b¥ô¦ó¼Ò²Õ¤¤¬Ò¥i¥Î
- EX:
- If Err.Number <> 0 Or Msg = True Then '·í¤é(©|¥¼¦³¸ê®Æ:¿ù»~) ©Î ¥ð¥«
- [color=Red]xDate = xDate - 1 (À³§ï¬°xDate = Date - 1)[/color] °²¦p¥ð¥«¶W¹L1¤Ñ¥H¤W(2,3,4,5,6,¬K¸`9¤Ñ)¡A¤S¦p¦óקï©O?
- 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 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
- End Sub
½Æ»s¥N½X ¦^´_ 5# GBKEE |
|
|
|
|
|
|
- ©«¤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 |
|
|
|
|
|
|
- ©«¤l
- 13
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 23
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- Office 2002
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2012-12-25
- ³Ì«áµn¿ý
- 2013-11-6
|
chen_cook «e½ú±M®a!·PÁ§AÀ°¦£©âªÅ¸Ñ´b¡C
¥i¬O§A»¡ªº¡q¥þ¦~¦æ¨Æ¾ä·íDATABASE¥ý¤ñ¹ï¡r¡A¤p¾Ç¥ÍÁÙ¬O¤£¤ÓÀ´©O!
¦]§Ú¤Wzªºµ{¦¡¬Oºô¸ô¤W«÷´ê¦Ó¨Ó¡AVBA¨ä¹ê»¡¯uªº§Ú¤£¬O«Ü¤F¸Ñ¡C
¦pªG·Ó§A»¡ªº¤è¦¡?¬O§_n¨Ï¥Î
If Then
Elseif(±Ôz¥¼ªÑ¥«¥ð¥«ªº¤é´Á)
Else
end if
³Â·Ðchen_cook «e½ú±M®a«ü¾É! |
|
|
|
|
|
|