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

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

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-15 20:52 ½s¿è

¦^´_ 20# HSIEN6001
²Ä¤@¦¸¤@©w¬O OK ªº¡A¦]¬°¦b D:\ ¤º ¥«.csv¡BÂd.csv ¨Ã¤£¦s¦b¡A«ö²Ä¤G¦¸®É¡A
©p¤S¦A¦¸¨Ï¥Î .SaveToFile (Apath & "¥«.csv") ¥H¤Î .SaveToFile (Apath & "Âd.csv")
©Ò¥H´N·|¥X¿ù¤F¡C
À³¸Ó¦b .SaveToFile() «e¥ý§PÂ_Àɮ׬O§_·~¤w¦s¦b¡A¦p¬Oªº¸Ü¡A´NÀ³¥ý¤©¥H§R°£«á¡A
¤~¯à°õ¦æ .SaveToFile()¡C
¦Ü©ó¦p¦ó¥h°õ¦æ§R°£°Ê§@(VBA »yªk)´N­n½Ð±Ð GBKEE ¤j¤j¤F¡C

TOP

¦^´_ 21# c_c_lai

¥u«ö¤@¦¸¦Ó¤w
µ{§Ç«á³B²z,¦³¤UKill «ü¥O§R°£ÀÉ®×
¦ý¤U¸ü¿ù»~ªº­¶­±,µLªk§¹¦¨©Ò¦³°Ê§@.

¥X²{¿ù»~ªº¤U¸ü   
<head>
<link rel='stylesheet' href='/ppp.css' type='text/css'>
</head>
<body>
<center>
<br><h4 align='center'><font color='red'>Àɮפ£¦s¦b</font></h4>
<!- filename1 = t108sb27_20120715_18181771.csv' --><br>
<!- filename2 = t108sb27_20120715_18181771.csv' -->
<!- fromNew =  -->

¤££¸©w¦b[¥«]or[Âd]¥X²{¿ù»~ªº¤U¸ü
¸ò¦^¶Ç³t«×¦³Ãö«Y?!

TOP

¦^´_ 18# GBKEE
§Ú«üªº¬O#16 ªº²Ä32¦æ
' (For 5 to 6)
' (For i = 0 To 4)                   <---   ¥¿½TÀ³¬° For i = 0 To 3
' Split("1ABCD2ABCD3ABCD4ABCD",Mid(A,5,1)) -> 'D'
' Join(W,',') -> 1ABC,2ABC,3ABC,4ABC,
'
10.png

TOP

¦^´_ 23# c_c_lai
§ä¤£¥X§Aªº¿ù»~
  1. Option Explicit
  2. Sub Ex() 'Split¦b¦r¦ê¤¤¥H«ü©wªº¦r¤¸§@¤À³Î¶Ç¦^¤@ºû°}¦C
  3.     Dim A As String, W, xi As Integer, i As Integer
  4.     A = "1ABCD2ABCD3ABCD4ABCD"
  5.    ' (For 5 to 6)
  6.     For i = 0 To 4       '   <---   ¥¿½TÀ³¬° For i = 0 To 3
  7.         W = Split("1ABCD2ABCD3ABCD4ABCD", Mid(A, 5, i)) ' '-> 'D'
  8.     MsgBox "¤À³Î¦r¦ê """ & Mid(A, 5, i) & """°}¦C¤W­­ºû«× " & UBound(W) & " ³Ì«á¤@ºû¦r¦ê: " & W(UBound(W)) '-> 1ABC,2ABC,3ABC,4ABC)
  9.     Next
  10. End Sub
½Æ»s¥N½X
¦^´_ 20# HSIEN6001
Split(¦r¦ê,¤À³Î¦r¤¸)(1)--->³o­Ó(1)¬O?·N«ä
18#¦³¥Ü½dªºµ{¦¡
  1. Sub Ex_Split() 'Split(¦r¦ê,¤À³Î¦r¤¸)(1)--->³o­Ó(1)¬O?·N«ä
  2.     Dim A As String, W, xi As Integer, i As Integer
  3.     A = "1ABCD2ABCD3ABCD4ABCD"
  4.     W = Split(A, "B")
  5.     For i = 0 To UBound(W)
  6.         MsgBox "W(" & i & ")  -> " & W(i)
  7.     Next
  8. End Sub
½Æ»s¥N½X
À£ÁYÀɤº¦³¨â­Ó¤U¸ü,¤@­Ó¬ONG,¤@­ÓOK
21#c_c_lai  ¤£¬O»¡
²Ä¤@¦¸¤@©w¬O OK ªº¡A¦]¬°¦b D:\ ¤º ¥«.csv¡BÂd.csv ¨Ã¤£¦s¦b¡A«ö²Ä¤G¦¸®É¡A
©p¤S¦A¦¸¨Ï¥Î .SaveToFile (Apath & "¥«.csv") ¥H¤Î .SaveToFile (Apath & "Âd.csv")
©Ò¥H´N·|¥X¿ù¤F¡C
  1. Sub Ex()
  2. Dim xml As New XMLHTTP
  3. Dim stream As New ADODB.stream
  4. Dim strURL As String
  5. Dim x As String, y As String
  6. Dim Apath As String, ApathFile As String
  7. Apath = "D:\"
  8. If Dir(Apath & "¥«.csv") <> "" Then Kill Apath & "¥«.csv"       '¥[¤W¦³«h§R°£ªº§PÂ_
  9. If Dir(Apath & "Âd.csv") <> "" Then Kill Apath & "Âd.csv"
½Æ»s¥N½X

TOP

¦^´_ 24# GBKEE
¦^´_ 21# c_c_lai

ÁÂÁ¨â¦ì¤j¤j«ü¾É
§Ú·|§V¤O®ø¤Æ
~·P®¦~^__^~

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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 26# c_c_lai

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

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD