Ãö©óµ{¦¡½X³o¤@¬q½Ð°Ý¦³¤H·|§ï¶Ü?
- ©«¤l
- 78
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 109
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-5-15
- ³Ì«áµn¿ý
- 2018-9-16
|
Ãö©óµ{¦¡½X³o¤@¬q½Ð°Ý¦³¤H·|§ï¶Ü?
³oÓvba§Ú¬O·Q©ñ¦b §Úªº "¤W¥«¤T¤jªk¤H¶R½æ¶W"¤À¶ , ¥i¥H«ü©w¤U¸ü¨ì³o¤@Ó¤À¶
¸Ó«ç»òקï¤j¤jµ¹ªºµ{¦¡½X©O?
Option Explicit
Sub EX()
Dim xDate As Date, genpage As String, qdate As String, Print_php As String, Wb As Workbook
'1 ¦p¤£¥i¬d¸ß·í¤é ¤T¤jªk¤H¶R½æ¶W¤é³ø
xDate = Date - 1
Do While Weekday(xDate, vbMonday) >= 6
xDate = xDate - 1
Loop
'¦p©ó¤@©wªº®É¶¡«á¥i¬d¸ß·í¤éªº ¤T¤jªk¤H¶R½æ¶W¤é³ø
'½Ð§R°£ ** xDate = Date - 1 **
'2 °õ¦æ¤U±ªºµ{¦¡½X,¨ú®øµù¸Ñ ** ' **
'If xDate = Date And Time < #5:00:00 PM# Then
' xDate = xDate - 1
'End If
For Each Wb In Workbooks
If Trim(Wb.Name) = "print.php" Then Wb.Close False
'¤U¸üCSV ªº¦WºÙ¬° Print_php ¥²¥ýÃö³¬
Next
genpage = Format(xDate, "yyyymm/yyyymmdd")
qdate = Format(xDate, "yyyymmdd")
Print_php = "http://www.twse.com.tw/ch/trading/fund/T86/print.php?edition=ch&filename=genpage/" _
& genpage & "_2by_issue.dat&type=csv&select2=ALLBUT0999&qdate=" & qdate
Set Wb = Workbooks.Open(Print_php)
End Sub |
|
|
|
|
|
|
- ©«¤l
- 78
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 109
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-5-15
- ³Ì«áµn¿ý
- 2018-9-16
|
Set Sh = Sheets.Add '·s¼Wªº¤u§@ªí
Rng.AutoFilter 1, "A" '*** ½Ðקï§Aªº¦Û°Ê¿z¿ï ±ø¥ó ***
With Sh '·s¼Wªº¤u§@ªí
Rng.Copy .[A1] '½Æ»s ¤w¦Û°Ê¿z¿ïªº½d³ò
¤j¤j§Ú¦b·s¼W¤u§@ªí«án§ì¨ú ¶±ªº³¡¥÷ÁÙ¬O·|¦³°ÝÃD
¥i¥Hª½±µ¦³©Ò¿× §ì¾ãÓexcel ¶±ªº ¤è¦¡¶Ü?
¦]¬°§Úªº¤ñ¨Ò³£¬O©T©wªº ´N¬O¶±©ç·Ó³o¼Ë |
|
|
|
|
|
|
- ©«¤l
- 78
- ¥DÃD
- 30
- ºëµØ
- 0
- ¿n¤À
- 109
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-5-15
- ³Ì«áµn¿ý
- 2018-9-16
|
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 1# vavashop
¸Õ¸Õ¬Ý- Option Explicit
- Sub EX()
- Dim xDate As Date, genpage As String, qdate As String, Print_php As String, Wb(1 To 2) As Workbook
- Set Wb(1) = Workbooks("¤W¥«¤T¤jªk¤H¶R½æ¶W") ' "¤W¥«¤T¤jªk¤H¶R½æ¶W"¤À¶
-
- '***¤T¤jªk¤H¶R½æ¶W¤é³ø À°§A¬d¸ß¹L,
- '[Àç·~®É¶¡¤º]¥u¯à¬d¬Ý«e¤@ÓÀç·~¤éªº³øªí.
- '©Ò¥H [Àç·~®É¶¡¤º] ¬d¸ß¤é : xDate = Date - 1
- xDate = Date
- If Time < #2:00:00 PM# Then '[Àç·~®É¶¡¤º] **
- Do While Weekday(xDate, vbMonday) = 1 Or Weekday(xDate, vbMonday) >= 6 '±Æ°£ ¶g¤é,¶g¤»,¶g¤@
- xDate = xDate - 1
- Loop
- ElseIf Time > #2:00:00 PM# Then '[Àç·~®É¶¡«á] ½Ð½Õ¾ã:¥xÃÒ¥æ©ö©Ò¸ê®Æ¾ã²z§¹²¦ªº®É¶¡
- Do While Weekday(xDate, vbMonday) >= 6 '±Æ°£ ¶g¤é,¶g¤»
- xDate = xDate - 1
- Loop
- End If
- For Each Wb(2) In Workbooks
- If Trim(Wb(2).Name) = "print.php" Then Wb(2).Close False '¤U¸üCSV ªº¦WºÙ¬° Print_php ¥²¥ýÃö³¬
- Next
- genpage = Format(xDate, "yyyymm/yyyymmdd")
- qdate = Format(xDate, "yyyymmdd")
- Print_php = "http://www.twse.com.tw/ch/trading/fund/T86/print.php?edition=ch&filename=genpage/" _
- & genpage & "_2by_issue.dat&type=csv&select2=ALLBUT0999&qdate=" & qdate
- Set Wb(2) = Workbooks.Open(Print_php)
- Wb(2).Sheets(1).Copy Wb(1).Sheets(1)
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|