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

[µo°Ý] ½Ð°Ý¦p¦ó¥HVBAÂ^¨úºô¯¸¤Wªº¸ê®Æ¡H

Sub qq()
Set shFirstQtr = ActiveSheet
Set qtQtrResults = shFirstQtr.QueryTables _
    .Add(Connection:="URL;http://tw.stock.yahoo.com/d/s/company_" & [a1] & ".html", _
        Destination:=shFirstQtr.Cells(3, 1))
With qtQtrResults
    .WebFormatting = xlNone
    .WebSelectionType = xlSpecifiedTables
    .WebTables = "9"
    .Refresh
End With
End Sub
§Ú·Q°Ý°Ý¨º»ò¦b³o¬q¥N½X¤¤
.Refreshstyle ¥i¥H´¡¦b¨º­Ó¦ì¸m¡H¡H
¦]¬°§Ú·Q³o­Ó¬OÂл\¸ê®Æ¦Ó¤£¬O¤£Â_´¡¤J

TOP

ÁÂÁÂoobirdª©¥D¤j¤j¡C
·PÁ±z¤Þ»â¤p§Ì¶i¤J
¥t¤@­Ó·sªº»â°ì¡C

·P®¦¤j¤j¡I

TOP

Dim qtQtrResults As QueryTable

TOP

ÁÂÁÂoobirdª©¥D¤j¤j¡C
·PÁ±zÀ°¤p§Ì¶}±Ò³o¤@®°¤jªù¡A
¦P®É¤]À°¤p§Ì·h¶}¤ß¤¤ªº¤@¶ô
¤j¥ÛÀY¡C
¤@»yÂI¿ô¦p¦¹¦n¥ÎªºEXCEL
¿ý»s¥\¯à¡A¤p§Ì«o±N¥¦¿ò§Ñ¡C

¥t¤p§Ì·Q«Å§i³]©w
DIM qtQtrResults AS ......
¤~¯àÅý¥¦¦bWITH qtQtrResults®É
¯àÅã¥Ü¥X¨äÄݩʤΥ\¯à©O¡H
With qtQtrResults
    .WebFormatting = xlNone
    .WebSelectionType = xlSpecifiedTables
    .WebTables = "9"
    .Refresh
End With

·P®¦¤j¤j¡I

TOP

³o¬Oexcelªº»¡©ú¤¤ªº½d¨Ò¼gªk¡A¤ñ¿ý»s±oªº¥N½X²¼ä¦h¤F
  1. Sub qq()
  2. Set shFirstQtr = ActiveSheet
  3. Set qtQtrResults = shFirstQtr.QueryTables _
  4.     .Add(Connection:="URL;http://tw.stock.yahoo.com/d/s/company_" & [a1] & ".html", _
  5.         Destination:=shFirstQtr.Cells(3, 1))
  6. With qtQtrResults
  7.     .WebFormatting = xlNone
  8.     .WebSelectionType = xlSpecifiedTables
  9.     .WebTables = "9"
  10.     .Refresh
  11. End With
  12. End Sub
½Æ»s¥N½X

TOP

¨ä¹ê§A¿ý»s¤@¤U´N¥i±o¨ì¥N½X¡A¦A§â2610§ï¦¨Àx¦s®æ¦ì§}¦p[a1], ¦p¦¹¦Ó¤w¡C
  1. Sub Macro2()
  2.     With ActiveSheet.QueryTables.Add(Connection:= _
  3.         "URL;http://tw.stock.yahoo.com/d/s/company_" & [a1] & ".html", _
  4.         Destination:=Range("A3"))
  5.         .Name = "company_" & [a1]
  6.         .FieldNames = True
  7.         .RowNumbers = False
  8.         .FillAdjacentFormulas = False
  9.         .PreserveFormatting = True
  10.         .RefreshOnFileOpen = False
  11.         .BackgroundQuery = True
  12.         .RefreshStyle = xlInsertDeleteCells
  13.         .SavePassword = False
  14.         .SaveData = True
  15.         .AdjustColumnWidth = True
  16.         .RefreshPeriod = 0
  17.         .WebSelectionType = xlSpecifiedTables
  18.         .WebFormatting = xlWebFormattingNone
  19.         .WebTables = "9"
  20.         .WebPreFormattedTextToColumns = True
  21.         .WebConsecutiveDelimitersAsOne = True
  22.         .WebSingleBlockTextImport = False
  23.         .WebDisableDateRecognition = False
  24.         .WebDisableRedirections = False
  25.         .Refresh BackgroundQuery:=False
  26.     End With
  27. End Sub
½Æ»s¥N½X

TOP

ª©¥D¤j¤j§A¦n¡G
       
   ¤p§Ì¹ï³z¹LEXCEL¨ú±oºô­¶¸ê®Æ¡A
¤@ª½²`²`·P¨ì¿³½ì¦ý¬OµLªk»â·|¤Î¬ð¯}§x¹Ò¡C
   ²{·Q­É¥Î¦¹ªO¤ÎªO¥D¤j¤j´£¨Ñªº»yªk¡C
¨Ã¨ú±o¦¹ºô­¶ªº«ü©w¦ì¸m¤º®e¦p¤U¡G

¤@¡B
   ºô§}¡Ghttp://tw.stock.yahoo.com/d/s/company_1102.html

¤G¡B
   ¨ú±o¦¹ºô­¶ªº¸ê®Æªí¬°

Àò §Q ¯à ¤O (100²Ä2©u) ³Ì·s¥|©u¨CªÑ¬Õ¾l  ³Ìªñ¥|¦~¨CªÑ¬Õ¾l

¤T¡B
  ¤p§Ì¦³¸ÕµÛª½±µ±N¤U¦C»yªkªººô§}§ó¥¿
¦p¤Wªººô§}¦ý¬OµLªk¦¨¥\¡C
¯à½Ðª©¥D¤j¤j«üÂI¤p§Ì¡C

·P®¦¤j¤j¡G


Sub ·s¼W¬d¸ß()
    Range("A1") = "2610"   'ªÑ²¼¥N¸¹
    Range("A3").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://tw.stock.yahoo.com/q/q?s=" & Range("a1"), Destination:=Selection)  '·s¼W¬d¸ß
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "6"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
        .Name = .ResultRange.Cells(3, 1)
    End With
   End Sub
'***** ¤w·s¼W«á¬d¸ß«á ¥i­×§ïA1ªºªÑ²¼¥N¸¹ ¬d¸ß  *****
Sub §ó·s¬d¸ß()
    With Range("A3").QueryTable
        .Connection = "URL;http://tw.stock.yahoo.com/q/q?s=" & Range("a1") 'ªÑ²¼¥N¸¹¦b[A1]
        .Refresh BackgroundQuery:=False
        .Name = .ResultRange.Cells(3, 1)
    End With
End Sub

TOP

·PÁµo¤å.¯uªº¥i¥H¥Î..¬O§_ÁÙ¦³¦P®É¯à§ì¦hÀɪº¤èªk?

TOP

·PÁª©¥D«ü¾É~
¤£¶i«h°h

TOP

¦^´_ 6# mnsmrtl
¥t¥~·Q¦A½Ð±Ð¡A¦p¦ó¥u¦^¶Ç¨ä¤¤¤@­ÓÄæ¦ì¡H
½Ð°Ñ¦Ò http://forum.twbts.com/thread-3064-1-2.html

webtables="6"¡A­n«ç»ò¨ú±o¡H




TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD