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

[µo°Ý] [½Ð±Ð]­ÓªÑ¦¨¥æ¸ê°T¥HVBAÂ^¨ú¤§°ÝÃD...

¦^´_ 2# chen_cook


ÁÂÁ¤j¤j, §Ú¦³¸Õ¹L¥i¦æ¤F!!

¥t¥~½Ð°Ý...
¥H¤U³o¤GºØ¼gªkªº·N¸q¦³¤£¦P¶Ü?
¬°Ô£²Ä¤@ºØ´N±o¤£¥Xdata©O?¬O¤£¬O¤Ö¼g¤°»ò??
(²Ä¤GºØ¤ñ¸û¬Ý±oÀ´,¦]¬°¼gIQY®É¤]¬O¥H³s¨ì¬Û¦PªºURL¥h§ìdata)
  1.     With ActiveSheet.QueryTables.Add(Connection:= _
  2.         "URL;http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/STOCK_DAYMAIN.php" _
  3.         , Destination:=Range("A1"))
  4.         .PostText = "ajax=true&myear=" & myear & "&mmon=" & mmon & "&STK_NO=" & STK_NO
½Æ»s¥N½X
  1.      With ActiveSheet.QueryTables.Add(Connection:= _
  2.          "URL;http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/genpage/Report" & mym & "/" & mym & "_F3_1_8_" & STK_NO & ".php?STK_NO=" & STK_NO & "&myear=" & myear & "&mmon=" & mmon _
  3.         , Destination:=Range("A1"))
  4. '
½Æ»s¥N½X
·s¤â¤W¸ô

TOP

¦^´_ 1# cudui


    Sub ­ÓªÑ¤é¦¨¥æ¸ê°T()
'
'
    Dim ptxt As String
    'Dim STK_NO, mmon As String
    myear = InputBox("¿é¤J¬d¸ß¥Á°ê¦~", "­ÓªÑ¤é¦¨¥æ¸ê°T")
   
    If myear = "" Then
       Exit Sub
    Else
       myear = myear + 1911
    End If
    mmon = InputBox("¿é¤J¬d¸ß¤ë,1-9¤ë»Ý¸É0¦p02¤ë", "­ÓªÑ¤é¦¨¥æ¸ê°T")
    If mmon = "" Then Exit Sub
   
    STK_NO = InputBox("¿é¤J­ÓªÑ¥N½X", "­ÓªÑ¤é¦¨¥æ¸ê°T")
    If STK_NO = "" Then Exit Sub
           
    mym = myear & mmon
     With ActiveSheet.QueryTables.Add(Connection:= _
         "URL;http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/genpage/Report" & mym & "/" & mym & "_F3_1_8_" & STK_NO & ".php?STK_NO=" & STK_NO & "&myear=" & myear & "&mmon=" & mmon _
        , Destination:=Range("A1"))
'
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingAll
        .WebTables = "8"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
           
   
End Sub

     ¸Õ¸Õ¬Ý§a!!

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD