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

¥Îexcel¤Wºô¬d­µ¼Ð ¤S±¾¤F

¥Îexcel¤Wºô¬d­µ¼Ð ¤S±¾¤F

¯u®`YAHOO!©_¼¯¦r¨å¤S§ïª©¤F
­µ¼Ð¤S§ä¤£¨ì¤F
¥u¯à¬Ý¨ì¸ÑÄÀ
·s¼Wªº§Y®Éµo­µ¦n¹³¯»¤£¿ù
    1. Sub searchIT(Rng As Range)
   2.     Dim XH As Object
   3.     Dim shpRm As Shape
   4.     '²M°£¤w¦³ªº¸ÑÄÀ¤Î­µ¼Ð
   5.     With Rng.EntireRow
   6.         .Resize(1, .Columns.Count - 1).Offset(0, 1).Clear
   7.     End With
   8.     '¶}±Òºô­¶
   9.     Set XH = CreateObject("Microsoft.XMLHTTP")
  10.     With XH
  11.         .Open "get", "http://tw.dictionary.yahoo.com/dictionary?p=" & Rng.Text, False
  12.         .send
  13.         On Error Resume Next
  14.         'ºK¨ú²Ä¤@²Õ¤¤¤å½Ķ
  15.         Rng.Offset(0, 2) = Split(Split(.responseText, "class=""description""><p>1.")(1), "<")(0)
  16.         'ºK¨úKK­µ¼Ð
  17.         Rng.Offset(0, 1) = Left(VBA.Split(.responseText, "KK</span>  ")(1), InStr(VBA.Split(.responseText, "KK</span>  ")(1), "]"))
  18.         
  19.     End With
  20.     Rng.Select
  21. End Sub
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-17 18:37 ½s¿è

¦^´_ 32# GBKEE
¤j­P¤W,¦³·§©À¤F~^^

¦^´_ 33# c_c_lai
¥Î "§PÂ_¦¡" ªºÅÞ¿è¥h¤U«ü¥O , ÁקK¤§«áµ{§Ç¦]On Error Resume Next
¥¼¥X²{°»¿ùªº¬q¸¨´£¥Ü ; ¦Ó²£¥ÍRun¥X¤£§¹¾ãªºµ²ªG
¬O³o¼Ëªº·N«ä¡A§ÚÁA¸Ñ!

¨ü¯q¨}¦h¡AÁÂÁ¨â¦ì¤j¤j«ü¾É!

TOP

¦^´_ 30# HSIEN6001
¦pªG©p¨Æ«e¨S¥[¤W On Error Resume Next °»´ú¨ÓÁ׶}¿ù»~ªº¸Ü¡A
¬O·|²£¥Í  °õ¦æ¶¥¬q¿ù»~ '53'¡G§ä¤£¨ìÀÉ®× ªº¡C
©p¨ººØ¼gªk¬O  ¤£ºÞ¤T¤C¤G¤Q¤@¥ý±þ¤F¦A»¡¡I
³o¦b¥¿³Wªºµ{¦¡¼¶¼g»yªk¤W¡A¬O¤£¤Ó¦nªº¡A¤]¬O§Ú·¥¤O¥hÁקKªº¡C
©úª¾·|²£¥Í¿ù»~«o¤S¨«®Ç¹DÁ׶}¡A­þ¤é¤£ÆF¥ú´N¶ã©I«s®â¤F¡I
Á`¤§§Ú¬O«Øij©p¾Ç²ß¥¿­y¼Ò¦¡¡A¹ï©pªº¥\¤O¼Wªø·|¦³¹ê½èÀ°§Uªº¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-7-17 17:14 ½s¿è

¦^´_ 31# HSIEN6001
³Ì¤pªº¯Á¤Þ­È¬O----> 0 ¶}©lªºªø¾ã¼Æ.  ³o¤£¤@©w
¨Ò  Dim A(4 To 7)  ->   ³Ì¤pªº¯Á¤Þ­È¬O 4 , ³Ì¤jªº¯Á¤Þ­È¬O7   
Option Base  0 ©Î 1   ¥i«ü©w³Ì¤pªº¯Á¤Þ­È¬° 0 ©Î 1
  1. Option Explicit
  2. Option Base 1
  3. 'Option Base ³¯­z¦¡ ¦b¼Ò²Õ¼h¦¸¤¤¥Î¨Ó«Å§i°}¦C¯Á¤Þªº¹w³]¤U­­¡C»yªk Option Base {0 | 1}
  4. Sub Ex_°}¦C()
  5. Dim A As String, W, xi As Integer, i As Integer
  6. W = Array("A", "B", "C", "D")
  7. MsgBox LBound(W)
  8. For i = LBound(W) To UBound(W)
  9. MsgBox "Array(""A"", ""B"", ""C"", ""D"")" & Chr(10) & "W(" & i & ") -> " & W(i)
  10. Next
  11. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-17 17:09 ½s¿è

¦^´_ 29# GBKEE

~¯Á¤Þ­È  ~
³Ì¤pªº¯Á¤Þ­È¬O----> 0 ¶}©lªºªø¾ã¼Æ.

³o#17
  1. Sub Ex_°}¦C()
  2.     Dim A As String, W, xi As Integer, i As Integer
  3.     W = Array("A", "B", "C", "D")
  4.     For i = LBound(W) To UBound(W)
  5.         MsgBox "Array(""A"", ""B"", ""C"", ""D"")" & Chr(10) & "W(" & i & ")  -> " & W(i)
  6.     Next
  7. End Sub
½Æ»s¥N½X
³o  
LBound(W) ---> LBound ¨ç数¥i¥H§ä¨ì数组¬Y¤@维ªº¤U­­¯Á¤Þ­È¡C
UBound(W)---> UBound ¨ç数¥i¥H§ä¨ì数组¬Y¤@维ªº¤W­­¯Á¤Þ­È¡C
¬GFor  i = LBound(W) To UBound(W) = 4 ­Ó¯Á¤Þ­È ; ³Ì¤pªø¾ã¼Æ¬°0  , ¬G i  = "W(" &  i & ") = 0 To 3
W(0) = A , W(1) = B , W(2) = C , W(3) = D

¦Ó : Split(¦r¦ê, "¤À³Î¦r¤¸")(1)---->«üªº¬O²Ä(1)­Ó¯Á¤Þ­È

¨âªÌªº() µL¬ÛÃö  ;¬O¤£¦PªºÀ³¥Î
.....³o¼ËªºÅÞ¿è,¹ï¶Ü?!

­n¥´µ²¤F   O_Q

TOP

¦^´_ 26# c_c_lai

³o¼Ë¤]¥i¦æ
On Error Resume Next
Kill Apath & "Âd.csv"
.SaveToFile (Apath & "Âd.csv")

TOP

¦^´_ 28# HSIEN6001
²Ä(¯Á¤Þ­È)­Ó¤À³Î   
LBound(W) ---> LBound ¨ç数¥i¥H§ä¨ì数组¬Y¤@维ªº¤U­­¯Á¤Þ­È¡C
UBound(W)---> UBound ¨ç数¥i¥H§ä¨ì数组¬Y¤@维ªº¤W­­¯Á¤Þ­È¡C
  1. Option Explicit
  2. Sub Ex()
  3.     Dim A(4 To 7), x As Integer
  4.     For x = LBound(A) To UBound(A)
  5.         A(x) = String(x, "A")
  6.     Next
  7.     MsgBox "LBound(A) =>¤U­­¯Á¤Þ­È" & LBound(A) & Chr(10) & _
  8.     "UBound(A) =>¤W­­¯Á¤Þ­È" & UBound(A) & Chr(10) & Join(A, "---")
  9. End Sub
½Æ»s¥N½X

TOP

¦^´_ 27# GBKEE


µª®×¬O--->²Ä(1)­Ó¤À³Î,¹ï¤F¶Ü?!

«Ü¦h»yªk³£¬O¥ý®M¥Î¡A¹ï¨ä²z¸Ñ«×ÁÙ¤£°÷
·s½d¨Ò¤]«Ü¦hÁÙ«Ü­¯¥Íªº,¦³§U©ó§Ú¦hÁA¸Ñ·N¸q
ÁÂÁ¤j¤j~^_^~

LBound(W) --->³Ì¤p¤§ªø¾ã¼Æ  'http://www.w3school.com.cn/vbscript/func_lbound.asp
UBound(W)--->³Ì¤j¤§ªø¾ã¼Æ 'http://msdn.microsoft.com/zh-cn/library/95b8f22f(v=vs.80).aspx

Chr(13) Âk¦ì;¦^¨®¡@Chr(10) ´«¦æ¡@Chr(9) TAB键ªºªÅ®æ¡@Chr(32) ªÅ®æ¡@Chr(34)  "¡@chr(0)则¬O¨t统±±¨î²Å¡Aªí¥ÜªÅ¡A¤]´N¬ONull
Chr(255) ¯S®íªÅ®æ ½d¨Ò'http://www.aspxhome.com/asp/startasp/20097/82213.htm
ASCII½X ¹ï·Óªí 'http://big5.webasp.net/article/15/14718.htm

¯uªº!!!!!!§Ú¦³»{¯u¦A®ø¤Æ O_Q

TOP

¦^´_ 25# HSIEN6001
§Ú·|§V¤O®ø¤Æ
  1. Option Explicit
  2. Sub Ex_°}¦C() 'Split(¦r¦ê,¤À³Î¦r¤¸)(1)--->³o­Ó(1)¬O?·N«ä
  3.     Dim A As String, W, xi As Integer, i As Integer
  4.     'A = "1ABCD2ABCD3ABCD4ABCD"
  5.     'W = Split(A, "B")
  6.     W = Array("A", "B", "C", "D")
  7.     For i = LBound(W) To UBound(W)
  8.         MsgBox "Array(""A"", ""B"", ""C"", ""D"")" & Chr(10) & "W(" & i & ")  -> " & W(i)
  9.     Next
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 24# GBKEE
¦^´_ 25# HSIEN6001
­ì¨Ó¥¦¬O¨Ï¥Î Kill ¤èªk¡C
  1. ' «ü©w¥Ø¿ý¤º¦pªG¸ÓÀɮפw¸g¦s¦b¡A«h±N¤§¤©¥H§R°£¡C
  2. If Dir(Apath & "¥«.csv") <> "" Then Kill Apath & "¥«.csv"         
  3. .SaveToFile (Apath & "¥«.csv")

  4. ' «ü©w¥Ø¿ý¤º¦pªG¸ÓÀɮפw¸g¦s¦b¡A«h±N¤§¤©¥H§R°£¡C
  5. If Dir(Apath & "Âd.csv") <> "" Then Kill Apath & "Âd.csv"         
  6. .SaveToFile (Apath & "Âd.csv")
½Æ»s¥N½X
¤S¾Ç¨ì¤F¡A ÁÂÁ¡I

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD