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

vba¶×¤J¨é°Ó¶i¥Xªí

§A¥i¥H¸Õ¸Õ¤@¥y¤@¥y¸Õ¸Õ¤F¸Ñ¤@¤U·N«ä
  1. Sub GetTransInfo()
  2. Worksheets("sheet2").Activate
  3. Call ¨é°Ó¶i¥X("2885", "sheet2", "A1")
  4. 'Call ¨é°Ó¶i¥X("2409", "sheet2", "A60")
  5. End Sub
  6. Sub ¨é°Ó¶i¥X(stock As String, tsheet As String, tcell As String)
  7.     '"all&stockid",
  8.     Call ¨é°Ó¶i¥X2("8,10,11", stock, tsheet, tcell)
  9. End Sub

  10. '(all&stockid,
  11. Sub ¨é°Ó¶i¥X2(tbl As String, stock As String, tsheet As String, tcell As String)
  12.      With Worksheets(tsheet).QueryTables.Add(Connection:="URL;http://yamstock.megatime.com.tw/asp/stockinfo/ps_top.asp?m=all&stockid=" & _
  13.         stock & "&name1=D2&index1=6", _
  14.         Destination:=Worksheets(tsheet).Range(tcell))
  15.         .Name = all & "_" & stock
  16.          .FieldNames = True
  17.         .FieldNames = True
  18.         .RowNumbers = False
  19.         .FillAdjacentFormulas = False
  20.         .PreserveFormatting = True
  21.         .RefreshOnFileOpen = False
  22.         .BackgroundQuery = False
  23.         .RefreshStyle = xlOverwriteCells
  24.         .SavePassword = False
  25.         .SaveData = True
  26.         .AdjustColumnWidth = True
  27.         .RefreshPeriod = 0
  28.         .WebSelectionType = xlSpecifiedTables
  29.         .WebFormatting = xlWebFormattingNone
  30.         .WebTables = tbl
  31.         .WebPreFormattedTextToColumns = True
  32.         .WebConsecutiveDelimitersAsOne = True
  33.         .WebSingleBlockTextImport = False
  34.         .WebDisableDateRecognition = False
  35.         .WebDisableRedirections = False
  36.         .Refresh BackgroundQuery:=False
  37.     End With

  38.     End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD