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

EXCELºô­¶¬d¸ß¦p¦óÁ׶}¤£¦s¦bºô­¶

EXCELºô­¶¬d¸ß¦p¦óÁ׶}¤£¦s¦bºô­¶

TEST´î¸ê¬d¸ß.rar (9.56 KB)
¤p§Ì¨C¤é¥ÎEXCELºô­¶¬d¸ß¦bÃÒ¥æ©Ò¤½§i°Ï"´î¸ê¤½§i"¬°¨C¤é¬d¸ß¤§¤@¶µ
¸ô®|:
http://www.twse.com.tw/docs1/data01/market/public_html/b9912.txt

Sub Macro1()
    For I = 1 To 12
    If I < 10 Then
    M = "0" & I
    Else: M = I
    End If
    RD = "99" & M
   
    MsgBox RD
   
    Sheets("´î¸ê¬d¸ß").Select
    Range("A1").Select
    With Selection.QueryTable
        .Connection = _
        "URL;http://www.twse.com.tw/docs1/data01/market/public_html/b" & RD & ".txt"
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
   
    Next I
End Sub

¦ý¬OÃÒ¥æ©Ò¤½§i°ÏÃö©ó"´î¸ê¤½§i"±Ä¤ë¥÷¬d¸ß¤è¦¡
·í¨C¤ëªì©|µL¸ê®Æ®É«h·|¥X²{¿ù»~°T®§¦Ó¤¤Â_¬d¸ß¤u§@

¨Ò¦p¤µ¦~(99)4,5¤ëµL¸ê®Æ
¾ú¥v¬d¸ß§Y·|¥X¿ù¦Ó¤¤Â_

¨ä¹ê¨C¤ë¤@¶}©l©|µL·s¸ê®Æ®É³£·|¤¤Â_!!

½Ð°Ý¦³¤èªkÅý·í¤ë©|µL¸ê®Æ®É ºô¸ô¬d¸ß¯à°»´ú¨ì ¦Ó¤£·|¤¤Â_¨ä«á¤u§@¤èªk¶Ü?

¦^´_ 1# chwqk
¸Õ¸Õ¬Ý
  1. Sub Macro1()
  2.     On Error Resume Next
  3.     For I = 1 To 12
  4.     If I < 10 Then
  5.     M = "0" & I
  6.     Else: M = I
  7.     End If
  8.     RD = "99" & M
  9.     MsgBox RD
  10.     Sheets("´î¸ê¬d¸ß").Select
  11.     Range("A1").Select
  12.     With Selection.QueryTable
  13.         .Connection = _
  14.         "URL;http://www.twse.com.tw/docs1/data01/market/public_html/b" & RD & ".txt"
  15.         .WebSelectionType = xlEntirePage
  16.         .WebFormatting = xlWebFormattingNone
  17.         .WebPreFormattedTextToColumns = True
  18.         .WebConsecutiveDelimitersAsOne = True
  19.         .WebSingleBlockTextImport = False
  20.         .WebDisableDateRecognition = False
  21.         .WebDisableRedirections = False
  22.         .Refresh BackgroundQuery:=False
  23.     End With
  24.     If Err > 0 Then
  25.         MsgBox "¬d¤£¨ì " & RD
  26.         Err.Clear
  27.     End If
  28.     Next I
  29. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD