- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2020-4-1 16:29 ½s¿è
¦^´_ 4# abc9gad2016
¸Õ¸Õ¬Ý- Sub §ó·s¥þ³¡()
- Call ¦@¥Î°Ñ·Ó: If uRow <= 0 Then Exit Sub
- uHead(0, 0) = "¡°§ó·s¤¤.............."
- uHead(2, 12).Resize(uRow).ClearContents
- For Each uRng In uClmnNo
- uRng(1, 3).Resize(1, 10).ClearContents
- ºô¶¤¸¯À_htmlfile uRng
- Beep
- Next
- uHead(0, 0) = "¡°§ó·s®É¶¡¡G" & Format(Now, "yyyy/mm/dd hh:mm:ss")
- ThisWorkbook.Save
- End Sub
- Sub ºô¶¤¸¯À_htmlfile(uRng As Range)
- Dim oXmlhttp As Object, oHtmldoc As Object, surl As String, E As Object, i As Integer
- Set oXmlhttp = CreateObject("msxml2.xmlhttp")
- Set oHtmldoc = CreateObject("htmlfile")
- If uRng = "" Then Exit Sub
- surl = "https://tw.stock.yahoo.com/q/q?s=" & uRng
- With oXmlhttp
- .Open "Get", surl, False
- .Send
- oHtmldoc.write .responseText
- End With
- On Error GoTo Ne '³B²zªÑ²¼¥N½X¤£¦s¦b®Éµ{¦¡ªº¥X¿ù
- With oHtmldoc
- Set E = .all.tags("TABLE")(2).Rows(1).Cells 'ªÑ²¼¥N½X¤£¦s®É E Is Nothing
- '** .Rows(1).Cells ºô¶ªí®æªº¤º®e ****
- uRng.Cells(1, 2) = Split(E(0).INNERTEXT, vbCrLf)(0) '¥h±¼´«¦æ«áªº¦r¤¸
- uRng.Cells(1, 2) = Replace(uRng.Cells(1, 2), uRng, "") '®ø°£ªÑ²¼¥N½X
- For i = 2 To E.Length - 2
- If i = 2 + 3 Then
- uRng.Cells(1, i + 1) = Mid(E(i).INNERTEXT, 2) '**®ø°£º¦¶^ªº²Å¸¹**
- Else
- uRng.Cells(1, i + 1) = E(i).INNERTEXT
- End If
- Next
- uRng.Cells(1, i + 1) = E(1).INNERTEXT '¥æ©ö®É¶¡
- End With
- Ne:
- uRng.Interior.Color = IIf(E Is Nothing, vbRed, xlAutomatic) '
- Set oXmlhttp = Nothing '
- Set oHtmldoc = Nothing
- End Sub
½Æ»s¥N½X |
-
1
µû¤À¤H¼Æ
-
|