ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

·J¤JÃÒ¥æ©Òªº¸ê®ÆµLªk§ó·s

·J¤JÃÒ¥æ©Òªº¸ê®ÆµLªk§ó·s

³o¬OÃÒ¥æ©Òºô§}http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report201007/A11220100723MS.php?
¦]¤wª¦¤å¤@¶gÁÙ¬OµLªk¸Ñ¨M
¦p¶×¤J2010/7/¢°¢¸¡A¦A§ó·s®É¡A¨C¦¸§ó·s«á¤´¬OÅã¥Ü2010/7/¢°¢¸ªº¸ê®Æ¡A¦Ó«D·í¤é¡A
¬O§_¥i¥H¦bA1³]©w¤é´Á
µM«á¦A¨Ì¤é´Á§ó·s
½Ð°ª¤â«üÂI¡A«ô°U!·P®¦!!
text.rar (11.11 KB)

¦^´_ 1# lman
  1. Sub Ex()
  2.     With ActiveSheet.QueryTables(1)
  3.         .Connection = _
  4.         "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Format(ActiveSheet.[A1], "YYYYMM") & "/A112" & Format(ActiveSheet.[A1], "YYYYMMDD") & "MS.php?select2=MS&chk_date=" & Format(ActiveSheet.[A1], "EE/MM/DD")
  5.         .WebSelectionType = xlSpecifiedTables
  6.         .WebFormatting = xlWebFormattingNone
  7.         .WebTables = "8"
  8.         .WebPreFormattedTextToColumns = True
  9.         .WebConsecutiveDelimitersAsOne = True
  10.         .WebSingleBlockTextImport = False
  11.         .WebDisableDateRecognition = False
  12.         .WebDisableRedirections = False
  13.         .Refresh BackgroundQuery:=False
  14.     End With
  15. End Sub
½Æ»s¥N½X

TOP

³o´N¬O±M·~
¤£±o¤£ªA
«D±`·PÁª©¥DGBKEE
¨ó§U¸Ñ¨M

TOP

ª©¥DGBKEE¤j¤j
©Ò¼gµ{¦¡¥i¨Ì¤é´Á¶×¤J¸ê®ÆµL»~
¦ý¬O¦³¤@ÂI«Ü¦n©_´£¥X°Ý¤@¤U(¦]¬°§Ú¤£À´)
µ{¦¡½X¤º®e¨S¦³¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
¬°¦ó©ñA3¥i¥H¦Û°Ê§ó·s
¦pªG¸ê®Æ°Å¤U½Æ»sB3¤]¥i¥H¦Û°Ê§ó·s
¦ü¥G·|¦Û°Ê·j´M§ó·s
¦pªG¬O«ü©w¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
¨º­n¦p¦ó­×§ï
ÁÂÁÂ

TOP

¦^´_ 4# lman   
µ{¦¡½X¤º®e¨S¦³¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
¬°¦ó©ñA3¥i¥H¦Û°Ê§ó·s


¦]¬°µ{¦¡®M¤W§AªþÀɤu§@ªí¤¤¤w¦³¤@­Ó¥~³¡¸ê®Æ¨Ó·½©Ò¶Ç¦^¤§¸ê®Æªº¬d¸ßªí ¨Ã«ü©w¤Fºô§}
¥u­n¨S¦³§R°£³o¬d¸ßªí °õ¦æµ{¦¡ ´N·|§ó·s¸ê®Æ
With  ActiveSheet.QueryTables(1)    '¥Nªí«ü©w¤u§@ªí¤¤¥~³¡¸ê®Æ¨Ó·½©Ò¶Ç¦^¤§¸ê®Æªº²Ä¤@­Ó¬d¸ßªí
.Connection = _
        "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Format(ActiveSheet.[A1], "YYYYMM") & "/A112" & Format(ActiveSheet.[A1], "YYYYMMDD") & "MS.php?select2=MS&chk_date=" & Format(ActiveSheet.[A1], "EE/MM/DD")      '¬d¸ßªíªººô§}
¦pªG¬O«ü©w¶×¤J¸ê®Æ¦s©ñªºÀx¦s®æ
  1. Sub Ex()
  2. Dim Rng As Range, OldRng$
  3. Set Rng = ActiveSheet.[J1] '«ü©w·sªº¦ì§} ¥B¤w«ü©w¤é´Á
  4. On Error GoTo QueryTablesAdd
  5. With Rng.QueryTable
  6. .Connection = _
  7. "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & Format(Rng, "YYYYMM") & "/A112" & Format(Rng, "YYYYMMDD") & "MS.php?select2=MS&chk_date=" & Format(Rng, "EE/MM/DD")
  8. .WebSelectionType = xlSpecifiedTables
  9. .WebFormatting = xlWebFormattingNone
  10. .WebTables = "8"
  11. .WebPreFormattedTextToColumns = True
  12. .WebConsecutiveDelimitersAsOne = True
  13. .WebSingleBlockTextImport = False
  14. .WebDisableDateRecognition = False
  15. .WebDisableRedirections = False
  16. .Refresh BackgroundQuery:=False
  17. End With
  18. End
  19. QueryTablesAdd:
  20. OldRng = Rng.Value
  21. Rng.Value = ""
  22. With ActiveSheet.QueryTables.Add(Connection:= _
  23. "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report201007/A11220100723MS.php?select2=MS&chk_date=99/07/23", Destination:=Rng)
  24. .Name = "¤j½L²Î­p¸ê°T"
  25. .WebTables = "8"
  26. .Refresh BackgroundQuery:=False
  27. .ResultRange.ClearFormats
  28. End With
  29. Rng.Value = OldRng
  30. Resume
  31. End Sub
½Æ»s¥N½X

TOP

¬ì§Þ©l²×¨Ó¦Û¤H©Ê
µ{¦¡½Xµy¬°­×§ï
¥iÅý°õ¦æ§e²{§ó²©ö
ÁÂÁ      ª©¥DGBKEE
¤G«hµ{¦¡½X¬Ò¤w¦¬¤U¬ã¨s¤¤

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD