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

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

¨ä¹ê§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

³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

Dim qtQtrResults As QueryTable

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD