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

¿é¤JªÑ²¼¥N¸¹,¸ê®Æ¤º®eÅã¥Ü©ó¤w½s¿èªºªí®æ¤º

¿é¤JªÑ²¼¥N¸¹,¸ê®Æ¤º®eÅã¥Ü©ó¤w½s¿èªºªí®æ¤º

¦U¦ì¤j¤j¦n~¦³¤p¤p°ÝÃD·Q½Ð±Ð
¥Ø«eÁÙ¦b¾Ç²ßVB¤¤,§Æ±æÂǥѹê°Èªº­×§ï
±q¤¤¶¡¶}©l¬ã¨s,¾Ç²ßVB

¥Ø«e¥\¯à¡G
¥i¥H¦bA1¿é¤J¥N¸¹¬d¸ßªÑ§Q¸ê®Æ
¨Ã¥BÅã¥Ü¦bA3

¦ý~ªí®æ¤£¯à½s¿è

°ÝÃD¡G
¡¶§Ú»Ý­n½s¿è,·Q­n¦Û¦æ³]­p¤@­Óªí®æ®æ¦¡
ÅýA3¿é¥Xªº¸ê®Æ¦b§Ú½s¿è¦nªºªí®æ®æ¦¡¤º

¡¶A1¿é¤J¤£¬O¥¿½TªºªÑ²¼¥N¸¹®É,©ÎªÌªÅ®æ¨S¿é¤J
¯à§_¦bB1Åã¥Ü"½Ð¿é¤J¥¿½TªÑ²¼¥N¸¹"

½Ð°Ý¥H¤W¦p¦ó¹ê²{?

¥H¤U¬Oµ{¦¡¥N½X
  1. Private Sub CommandButton1_Click()
  2.     Dim strURL$ '«Å§istrURL¬°ÅܼÆ
  3.     strURL = "https://tw.stock.yahoo.com/d/s/dividend_" & [A1].Value & ".html" '©w¸qstrURLÅܼƤº®e
  4.     [A3].CurrentRegion.Clear
  5.     With ActiveSheet.QueryTables.Add("url;" & strURL, Range("a3"))
  6.         .WebFormatting = xlWebFormattingNone '(NONE)¤£¥]§t®æ¦¡,(ALL)¥]§t®æ¦¡
  7.         .WebSelectionType = xlSpecifiedTables '«ü©wtableªí®æ¼Ò¦¡
  8.         .WebTables = "8" '²Ä8­Ótableªí®æ
  9.         .Refresh False
  10.     End With
  11. End Sub
½Æ»s¥N½X
«D±`·PÁÂ...

EX1.rar (17.78 KB)


ªþ¤WÀÉ®×

¤j¤O³»¤W¥h

TOP

¦^´_ 3# bioleon69

¡¶§Ú»Ý­n½s¿è,·Q­n¦Û¦æ³]­p¤@­Óªí®æ®æ¦¡,ªþÀɨS¦³§A¦Û¦æ³]­p¤@­Óªí®æ.
ÅýA3¿é¥Xªº¸ê®Æ¦b§Ú½s¿è¦nªºªí®æ®æ¦¡¤º,§A­n¦p¦ó½s¿èªþÀɨS¦³»¡©ú.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

EX1.rar (17.5 KB)


µæ³¾§Ú¤w¸g²³æªº§âªí®æ¤ºµÛ¦â
ÁÙ¦³¥Î¤F²³æ®Ø½u¥H¤Î¦r«¬
¥D­n¬O§Æ±æ¥´¤JªÑ²¼¥N¸¹«á
A3©Ò§e²{ªº¸ê®Æ®æ¦¡¬O¨Ì·Ó§Ú¥H¤W©Ò½s¿èªºªí®æ¤º®æ¦¡


°ÝÃD¡G
¡¶
ÅýA3¿é¥Xªº¸ê®Æ¦b§Ú¬ü¤Æ¦nªºªí®æ¤º


¡¶
A1¿é¤J¤£¬O¥¿½TªºªÑ²¼¥N¸¹®É,©ÎªÌªÅ®æ¨S¿é¤J
¯à§_¦bB1Åã¥Ü"½Ð¿é¤J¥¿½TªÑ²¼¥N¸¹"


½Ð¨D¦U¸ô¤j«LÀ°§U!!!

TOP

¦^´_ 4# bioleon69

¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim strURL$ '«Å§istrURL¬°ÅܼÆ
  4.     strURL = "https://tw.stock.yahoo.com/d/s/dividend_" & [A1].Value & ".html" '©w¸qstrURLÅܼƤº®e
  5.     [A3].CurrentRegion = ""   '²M°£¤å¦r¨S²M°£®æ¦¡(¬ü¤Æ¦nªºªí®æ)
  6.     With ActiveSheet.QueryTables.Add("url;" & strURL, Range("a3"))
  7.         .WebFormatting = xlWebFormattingNone '(NONE)¤£¥]§t®æ¦¡,(ALL)¥]§t®æ¦¡
  8.         .WebSelectionType = xlSpecifiedTables '«ü©wtableªí®æ¼Ò¦¡
  9.         .WebTables = "8" '²Ä8­Ótableªí®æ
  10.         On Error Resume Next
  11.         .Refresh False
  12.         If Err <> 0 Then
  13.             [B1] = "½Ð¿é¤J¥¿½TªÑ²¼¥N¸¹"
  14.         Else
  15.             [B1] = ""
  16.         End If
  17.     End With
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

§¹¥þ¥i¥H¨Ï¥Î!!
GBª©¤j«D±`ªº·PÁ±z
¯uªº«Ü¼F®`!
¦^®a«á·|¦n¦n¬ã¨s±z¥Ø«eªº¨ç¼Æ
§â¥¦¦n¦n¾Ç°_¨Ó!!


·|¦A«×¨Ó¥´ÂZ±zªº!!«¢«¢!!!
¯¬¤@¤Á¶¶¤ß ¨­Åé°·±d °]·½ºuºu~~

TOP

GBK¤j~~§Ú¤S¨Ó¤Fªü!!«¢«¢
¤w¸g¶}©l¦b¬ã¨s±zªºµ{¦¡½X¤F~!!

¥Ø«e¤S¹J¨ì2­Ó¤p°ÝÃD

@
A3¸ê®Æ§e²{½T¹ê¥i¥H½s¿èªí®æ¤º¤å¦rÃC¦â­I´ºµ¥µ¥ªº!³oÃä¬OOK!
¦ý¬O"Äæ¼e"³¡¤À ·|¶]¦^¥h
"Äæ¼e"¬O§_¥i¥H¹ê²{¦p¦P¤å¦rÃC¦â­I´º¤@¼Ë,¯à°÷¦Û¾AÀ³?
@
¦b¬d¸ß¥¢±Ñ,B1·|Åã¥Ü"½Ð¿é¤J¥¿½TªÑ²¼¥N¸¹"
³o³¡¤À§¹¬ü!¥i¨Ï¥Î!!¥¿±`¹B§@!!
¨º¤Ï¤§,¦pªG¬d¸ß¦¨¥\¤F,B1®æ¤º´N·|"ªÅ¥Õ"
©Ò¥H§Ú·Q»¡
¬O§_¥i¥H¹ê²{¬d¸ß¦¨¥\,"B1"´NÅã¥Ü©Ò¿é¤JªºªÑ»ù¥N¸¹¥H¤Î¦WºÙ?


·PÁÂGBK¤j¤j~~±z¨¯­W¤F~~~~!!!!

TOP

ex2.rar (20.09 KB)

ªþ¤WÀÉ®×~~~~~

¦A¦¸·PÁ¤j¤j!!!

TOP

¦^´_ 8# bioleon69
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim strURL$ '«Å§istrURL¬°ÅܼÆ
  4.     strURL = "https://tw.stock.yahoo.com/d/s/dividend_" & [A1].Value & ".html" '©w¸qstrURLÅܼƤº®e
  5.     [A3].CurrentRegion = ""   '²M°£¤å¦r¨S²M°£®æ¦¡(¬ü¤Æ¦nªºªí®æ)
  6.     With ActiveSheet.QueryTables.Add("url;" & strURL, Range("a3"))
  7.         .WebFormatting = xlWebFormattingNone '(NONE)¤£¥]§t®æ¦¡,(ALL)¥]§t®æ¦¡
  8.         .WebSelectionType = xlSpecifiedTables '«ü©wtableªí®æ¼Ò¦¡
  9.         .WebTables = "8" '²Ä8­Ótableªí®æ
  10.         On Error Resume Next
  11.         .Refresh False
  12.         [B1] = ""
  13.         If Err <> 0 Then
  14.             [B1] = "½Ð¿é¤J¥¿½TªÑ²¼¥N¸¹"
  15.         Else
  16.             '**********************************
  17.             '"Äæ¼e"¬O§_¥i¥H¹ê²{¦p¦P¤å¦rÃC¦â­I´º¤@¼Ë,¯à°÷¦Û¾AÀ³?
  18.             '½Ð¿ý»s¥¨¶°«á®M¥Îµ{¦¡½X¦b¦¹
  19.             '*****************************'
  20.             [B1] = ºô­¶(strURL)  '¶ñ¤WªÑ²¼¦WºÙ¥N¸¹
  21.         End If
  22.     End With
  23. End Sub
  24. Private Function ºô­¶(Surl As String) As String
  25.     Dim oXmlhttp As Object, oHtmldoc As Object
  26.     Set oXmlhttp = CreateObject("msxml2.xmlhttp")
  27.     Set oHtmldoc = CreateObject("htmlfile")
  28.     With oXmlhttp
  29.         .Open "Get", Surl, False
  30.         .Send
  31.         oHtmldoc.write .responseText
  32.     End With
  33.     ºô­¶ = Split(oHtmldoc.Title, "-")(0)
  34. End Function
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦nªº,·PÁÂGBK¤j
¥Ø«e´ú¸ÕOK!¤]§â¥¨¶°½Æ»s¶i¥h¤F!!
»Ý­nªáÂI®É¶¡¬ã¨s~µ{¦¡½X©¿µMÃz¬µ©Ê¦¨ªø¤F«¢
ÁÂÁÂ~~~~³o­Óºô§ìµ{¦¡½X½T¹ê¦n¥Î!!
±j!

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD