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

¸ü¤J¾ú¦~ªÑ§Q¬Fµ¦

¦^´_ 1# pupai
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Const ¸ê°T = "­ÓªÑ¸ê°T"
  3. Const ¥Dªí = "¬d¸ßªí"
  4. Sub ¸ü¤J¥þ³¡¼Æ¾Ú()
  5.     Dim Rng As Range, e As Range
  6.     With Sheets(¥Dªí)
  7.         .Range(.[a4], .[a4].End(xlDown)).Offset(, 1).Resize(, 11) = ""
  8.         For Each e In .Range(.[a4], .[a4].End(xlDown))
  9.             ¼Æ¾Ú e
  10.         Next
  11.      End With
  12. End Sub
  13. Sub ¸ü¤J­ÓªÑ¼Æ¾Ú()
  14.     ¼Æ¾Ú ActiveCell
  15.     ActiveCell.Resize(, 12).Select
  16. End Sub
  17. Private Sub ¼Æ¾Ú(xRng As Range)
  18.     Dim xUrl As String
  19.      If xRng.Parent.Name <> ¥Dªí Then MsgBox "½Ð¿ï¾Ü " & ¥Dªí & " ªº­ÓªÑ½s¸¹ ½d³ò  ": Exit Sub
  20.      With Sheets(¥Dªí)
  21.         If Intersect(.Range(.[a4], .[a4].End(xlDown)), xRng) Is Nothing Then MsgBox "½Ð¿ï¾Ü " & ¥Dªí & " ªº­ÓªÑ½s¸¹ ½d³ò  ": Exit Sub
  22.     End With
  23.     xUrl = "URL;http://tw.stock.yahoo.com/d/s/dividend_" & xRng & ".html"
  24.     With Sheets(¸ê°T)
  25.         If .QueryTables.Count <> 0 Then
  26.             .QueryTables(1).Connection = xUrl
  27.         Else
  28.         .QueryTables.Add xUrl, .[A1]
  29.         End If
  30.         With .QueryTables(1)
  31.             .WebSelectionType = xlSpecifiedTables
  32.             .WebTables = "7,10"
  33.             .Refresh BackgroundQuery:=False
  34.             xRng.Cells(1, 2) = Replace(Split(.ResultRange.Cells(1, 1), " ")(0), xRng, "")
  35.             xRng.Cells(1, 3).Resize(, 10) = Application.WorksheetFunction.Transpose(.ResultRange.Cells(6, 6).Resize(10))
  36.             xRng.Cells(1, 3).Resize(, 10).NumberFormatLocal = "G/³q¥Î®æ¦¡"
  37.         End With
  38.     End With
  39.     Beep
  40. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD