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

[µo°Ý] ªÑ»ùVBAªºÀÉ®×µLªk§ó·s

[µo°Ý] ªÑ»ùVBAªºÀÉ®×µLªk§ó·s

¥»©«³Ì«á¥Ñ abc9gad2016 ©ó 2020-3-31 14:49 ½s¿è

ª©¤W«e½ú¦n¡A¦Û±q³vµ§¥æ©ö¶}©l«á¡A§ÚªºEXCEL§ì¨úªÑ²¼§Y®É»ù´NµL¦^À³

­ì¥»¥H¬°¬OYAHOO STOCK¨ºÃäºô§}¦³ÅÜ¡A©Ò¥H§ó·s¤Fºô§}

¦ýµ²ªGÁÙ¬O¤@¼Ë...·Q½Ðª©¤W°ª¤âÀ°¦£¬Ý¬Ý¬O¤°»ò­ì¦]³y¦¨µLªk§ó·sªº ÁÂÁÂ

ªÑVBA.rar (39.08 KB)
PS.¦¹Àɮ׬Oª©¥D­ã¤j©Ò¤À¨Éªº¡A§Ú¥u°µ¤F¤@¨Ç¦Û¤v·Q­nªºÄæ¦ìÅܧ󠠸U¤À·PÁÂ

§Úªº§@·~Àô¹ÒÁÙ¬O XP+office 2000
¹ïyahoo¤Î¤j³¡¥÷ºô­¶¨S»³,
¬Ý¦³§_¨ä¥L¤j¤j¥N¬°­×§ïµ{¦¡,
©Î³\¶Ç°T®§µ¹¶Wª©¨Ó¬Ý¬Ý~~

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-4-1 00:51 ½s¿è

¦^´_ 1# abc9gad2016

Yahoo¥i¯à¦³§ïºô­¶½s¼g®æ¦¡

¤U­±µ{¦¡ªºST2ªº¦r¦ê¦bYahooºô­¶­ì©l½X¤w¸g§ä¤£¨ì¤F

­ìµ{¦¡¬O¥ÎST1¦r¦ê»PST2¦r¦êÂ^¨ú¤@¬q»Ý­nªº­ì©l½X¸ê°T~

©Z¥Õ»¡¡A§Ú¤£¤j³ßÅw¥L¸Ñ¦r¦êªº¤è¦¡......¬Ýªº«Ü²Ö...........

­ìµ{¦¡¦p¤U:


Sub Â^¨ú¸ê®Æ()
Dim ReTxt, i&, ARR, BRR(9), V As Currency, GetTime$
uTxtStr = ""
Call ¨ú±oºô­¶­ì©l½X: If uTxtStr = "" Then Exit Sub
'-----------------------------------------------------
GetStr = ""
ST1 = "href=""/q/bc?s=" & uRng & """>"
ST2 = "<a href=""/q/ts?s=" & uRng & """>¦¨¥æ©ú²Ó</a>"
GetStr = Â^¨ú¤å¦r½X(uTxtStr, ST1, ST2):  If GetStr = "" Then Exit Sub


§â¤W­±µ{¦¡ªºST2³¡¤À¡A§ï¦¨¦p¤U´N¥i¥H¤F

ST2 = "<a href=""/q/ts?s=" & uRng & """>¦¨¥æ·J¾ã</a>"

©ú²Ó  >>>  ·J¾ã



ªþ¤W§Ú¦Û¤v°µªº³¡¤À¦p¤U ¡AªOExcel¤£¤ä´©¶W¹L7¼hªº¨ç¼Æ¡A¤½¦¡·|¥¢®Ä

¦ý¬O¤£¼vÅTºô¸ô§ì¸ê®Æ¡A§Ú§ìªººô¯¸¬OHi§ë¸ê¡A§Ú¦Û»{¼gªºÀ˵u¦h¤F~À³¸Ó§a!



²z°]µ¦²¤V1.0.rar (91.56 KB)
1

µû¤À¤H¼Æ

µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 3# n7822123


   ·PÁ¤j¤j¤À¨É~¥t¥~­ìª©ªº¨Ì·Ó¤j¤j©Ò»¡ªºÅܧó¤]¯à¦¨¥\§ì¨ú¤F ÁÂÁÂ

TOP

¦^´_ 3# n7822123
·PÁÂn7822123¤jªº¤À¨É
¦~ÄÖ¤£¤p,¦ý§Ú«Ü·Q¾Ç

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2020-4-1 16:29 ½s¿è

¦^´_ 4# abc9gad2016
¸Õ¸Õ¬Ý
  1. Sub §ó·s¥þ³¡()
  2.     Call ¦@¥Î°Ñ·Ó: If uRow <= 0 Then Exit Sub
  3.     uHead(0, 0) = "¡°§ó·s¤¤.............."
  4.     uHead(2, 12).Resize(uRow).ClearContents
  5.     For Each uRng In uClmnNo
  6.         uRng(1, 3).Resize(1, 10).ClearContents
  7.         ºô­¶¤¸¯À_htmlfile uRng
  8.         Beep
  9.     Next
  10.     uHead(0, 0) = "¡°§ó·s®É¶¡¡G" & Format(Now, "yyyy/mm/dd hh:mm:ss")
  11.     ThisWorkbook.Save
  12. End Sub

  13. Sub ºô­¶¤¸¯À_htmlfile(uRng As Range)
  14.     Dim oXmlhttp As Object, oHtmldoc As Object, surl As String, E As Object, i As Integer
  15.     Set oXmlhttp = CreateObject("msxml2.xmlhttp")
  16.     Set oHtmldoc = CreateObject("htmlfile")
  17.    If uRng = "" Then Exit Sub
  18.     surl = "https://tw.stock.yahoo.com/q/q?s=" & uRng
  19.     With oXmlhttp
  20.         .Open "Get", surl, False
  21.         .Send
  22.         oHtmldoc.write .responseText
  23.     End With
  24.     On Error GoTo Ne    '³B²zªÑ²¼¥N½X¤£¦s¦b®Éµ{¦¡ªº¥X¿ù
  25.      With oHtmldoc
  26.         Set E = .all.tags("TABLE")(2).Rows(1).Cells  'ªÑ²¼¥N½X¤£¦s®É  E Is Nothing
  27.         '** .Rows(1).Cells ºô­¶ªí®æªº¤º®e ****
  28.         uRng.Cells(1, 2) = Split(E(0).INNERTEXT, vbCrLf)(0)     '¥h±¼´«¦æ«áªº¦r¤¸
  29.         uRng.Cells(1, 2) = Replace(uRng.Cells(1, 2), uRng, "") '®ø°£ªÑ²¼¥N½X
  30.         For i = 2 To E.Length - 2
  31.                If i = 2 + 3 Then
  32.                     uRng.Cells(1, i + 1) = Mid(E(i).INNERTEXT, 2) '**®ø°£º¦¶^ªº²Å¸¹**
  33.                 Else
  34.                     uRng.Cells(1, i + 1) = E(i).INNERTEXT
  35.                 End If
  36.         Next
  37.         uRng.Cells(1, i + 1) = E(1).INNERTEXT  '¥æ©ö®É¶¡
  38.     End With
  39. Ne:
  40.   uRng.Interior.Color = IIf(E Is Nothing, vbRed, xlAutomatic) '
  41.     Set oXmlhttp = Nothing  '
  42.     Set oHtmldoc = Nothing
  43. End Sub
½Æ»s¥N½X
1

µû¤À¤H¼Æ

·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 1# abc9gad2016

ªþÀɬO§Ú­×§ï¹LªºÀɮסA¥i¥H¤U¸ü¸Õ¬Ý¬Ý¡C
_ª÷¤d¨½ªÑ²¼ºÊ¬Ý¨t²Î.zip (31.9 KB)
1

µû¤À¤H¼Æ

°Ñ¦Ò¸ê®Æ¡G
http://bestdaylong.com

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD