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

¥Îexcel¤Wºô¬d­µ¼Ð

§Ú¤]¬O¤@¼Ëªº°ÝÃD ¥d¦bsend,½Ð°Ý¦p¦ó³B²z

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-26 13:41 ½s¿è

¦^´_ 1# ¦Û§Ú·Pı¨}¦n
¦^´_ 2# Hsieh
¦^´_ 6# GBKEE
  1. Option Explicit

  2. Sub searchIT(Rng As Range)
  3.     Dim XH As Object
  4.     Dim shpRm As Shape
  5.    
  6.     '  ²M°£¤w¦³ªº¸ÑÄÀ¤Î­µ¼Ð
  7.     With Rng.EntireRow
  8.         .Resize(1, .Columns.Count - 1).Offset(0, 1).Clear
  9.     End With
  10.    
  11.     '  ¶}±Òºô­¶
  12.     Set XH = CreateObject("Microsoft.XMLHTTP")
  13.     With XH
  14.         .Open "get", "http://tw.dictionary.search.yahoo.com/search?p=" & Rng.Text, False
  15.         .send
  16.         On Error Resume Next
  17.         '  ºK¨ú²Ä¤@²Õ¤¤¤å½Ķ
  18.         '  Rng.Offset(0, 2) = Split(Split(.responseText, "class=""description""><p>1.")(1), "<")(0)
  19.         If InStr(.responseText, "><h4>1.") > 0 Then Rng.Offset(0, 2) = Trim(Split(Split(.responseText, "><h4>1.")(1), "<")(0))
  20.         '  ºK¨úKK­µ¼Ð
  21.         '  Rng.Offset(0, 1) = Left(VBA.Split(.responseText, "KK</span>  ")(1), InStr(VBA.Split(.responseText, "KK</span>  ")(1), "]"))
  22.         '  Rng.Offset(0, 1) = Split((Split(.responseText, "KK</span>")(1)), "<span>")(0)
  23.         If InStr(.responseText, ">KK[") > 0 Then Rng.Offset(0, 1) = "[" & Split(Split(.responseText, ">KK[")(1), "]")(0) & "]"
  24.     End With
  25.    
  26.     Rng.Select
  27. End Sub

  28. Sub Ex()
  29.     Dim Rng As Range
  30.    
  31.     For Each Rng In ActiveSheet.Range("A1", ActiveSheet.Range("A" & Rows.Count).End(xlUp))
  32.         Rng.Select
  33.         If Rng.Value <> "" Then
  34.             searchIT Rng
  35.         End If
  36.     Next
  37. End Sub
½Æ»s¥N½X

E.png (18.87 KB)

E.png

E.png (18.87 KB)

E.png

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD