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

¤£¥Î°j°é¡A¤£¥ÎWorksheet¨ç¼Æ¡]matchµ¥¡^¡A§PÂ_¬Yelement¦b¬O§_°}¦C¤¤

¤£¥Î°j°é¡A¤£¥ÎWorksheet¨ç¼Æ¡]matchµ¥¡^¡A§PÂ_¬Yelement¦b¬O§_°}¦C¤¤

¨Ò¦p
  1. Sub ss_test1()
  2.     alltype = Array("AÃþ", "BÃþ", "CÃþ", "DÃþ", "EÃþ", "FÃþ", "GÃþ", "HÃþ", "IÃþ", "JÃþ")
  3.     aj = "1DÃþ"
  4.     If UBound(Filter(alltype, aj)) < 0 Then Debug.Print "Empty"
  5.     Stop
  6. End Sub
½Æ»s¥N½X
ss

¦^´_ 8# sunnyso

ÁöµM³o­Ó°Q½×¦ê¾ú¥v¤w¤[¡A(4¦~«e...
¦ý¤´µM¹ï§Ú¦³«Ü¤jªºÀ°§U¡A
ÁÂÁ¦U¦ì¥ý¶iªºÀ°§U¡I

¦ý 05. ¤¤ ¡uAj = S & "DAÃþ" & S¡v¦³ÂI¤pºÃ°Ý¡A
­Y¦¹®É·j´M¹ï¶HÅܦ¨JÃþªº®É­Ô¡A
«K·|µLªk§ä¨ì¡A
­ì¦]¦b©ó¡A
Aj ¸g 05. ³B²z«á¡AÅܦ¨¡u,JÃþ,¡v
¦ý Ar ¦r¦ê¦b 06. ³B²z«á¡AÅܦ¨¡u ,DAÃþ,BÃþ,DECÃþ,ECÃþ,CÃþ,FÃþ,GÃþ,HÃþ,IÃþ,JÃþ¡v
¦¹®É¥ÎInStr(Ar, Aj)¡Aµ´¹ï·|µ¥©ó 0

¸Õ°Ý¡A
05. ¤¤¡A«á­±ªº&S­ì¥»¥ß·N¬°¦ó¡H
¬O¤£¬O§Q¥Î¨â­Ó","¨Ó¨M©w¦r¦êªºÀY»P§À¡H
­Y¬O¦p¦¹¡A¦pªG¦b¡uAr = " " & S & Join(alltype, S)¡v«á­±°l¥[ & S¡A·|§ó§¹¬ü¡H:P

³Ì«á¡AÁÙ¬O·PÁ¦U¦ì¤j¤j¡A
©~µM¥i¥H¬¡¥ÎJoin¦A°t¦XInStr¹F¨ì§P©w¬O§_¦s¦bªº¥Øªº¡A
³Ì«á¦A³sÄò§Q¥ÎSplit¨Ã°t¦XUBound¨Ó«ü¥X¸Ó¶µ¥Øªº¦ì¸m¡A
¹ê¦b¼F®`¡IXD

TOP

¦^´_ 9# GBKEE

6¼Óªºcode¾A¦X¥HÃöÁä¦r¨Ó§PÂ_elementªº¦ì¸m
ss

TOP

¦^´_ 8# sunnyso
¦b¦¹°Q½×°Ï´N¬O­n¦³¦p¦¹ªº¥æ¬yºë¯«,ÁÂÁ§A
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE

³o¼Ë¥i¥H¤Ö¤@IF§PÂ_
  1. Sub Ex()
  2.     Dim S As String, alltype(), Aj As String, Ar  As String
  3.     S = ","                           '»²§U¦r¦ê
  4.     alltype = Array("DAÃþ", "BÃþ", "DECÃþ", "ECÃþ", "CÃþ", "FÃþ", "GÃþ", "HÃþ", "IÃþ", "JÃþ")
  5.     Aj = S & "DAÃþ" & S
  6.     Ar = " " & S & Join(alltype, S)
  7.     If InStr(Ar, Aj) = 0 Then
  8.         Debug.Print "Empty"
  9.     Else
  10.        Ar = Split(Ar, Aj)(0)
  11.        Debug.Print UBound(Split(Ar, S))
  12.     End If
  13. End Sub
½Æ»s¥N½X
1

µû¤À¤H¼Æ

    • GBKEE: ºë«~¤å³¹ª÷¿ú + 4
ss

TOP

¦^´_ 6# GBKEE

ªº½T¡A¦A·Q·Q¦³¨S¦³§ó¦nªº¤èªk
ss

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-7-1 10:09 ½s¿è

¦^´_ 5# sunnyso
ÁÂÁ«ü¥¿¦³¿ù·í§ï , 4#¤w­×¥¿.

¥i¬O¦p³o¼ËÁÙ¬O¦³bug §ä¨ì "JJÃþ"
  1. Sub ss_teswt()
  2.     alltype = Array("AÃþ", "BÃþ", "CÃþ", "DÃþ", "JJÃþ", "FÃþ", "GÃþ", "HÃþ", "IÃþ", "JÃþ")
  3.     Aj = "JÃþ"
  4.     If UBound(Filter(alltype, Aj)) < 0 Then
  5.         Debug.Print "Empty"
  6.     Else
  7.         Debug.Print UBound(Split(Split(" " & Join(alltype, "|"), Aj)(0), "|"))
  8.     End If
  9.     'Stop
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ sunnyso ©ó 2013-7-1 09:41 ½s¿è

¦^´_ 4# GBKEE


ª©¤j§Aªºcode¦³bug¡A¸ò§Ú²Ä¤@¦¸ªºcode¡]2¼Ó¡^¤@¼Ëªºbug¡C´N¬O²Ä¤@element¡]§Y: "AÃþ") ¦^¶Ç -1
À³¸Ó¹³§Ú3¼Óªº§ï°Ê¡]©ÎªÌ¬Ý§Ú¥t¤@©«¤l¡^¤~¥i¥H¡A¦bJoin «áªº AllType«e­±¥[¤W¤@­Ó¥ô·N«D S¡]»²§U¦r¦ê¡^ªº¦r¦ê¡A¨Ò¦p¡§<space>", ¤£µM²Ä¤@­Óemement·|¦^¶Ç-1¡A ÁÙ¦³¦bJoin «áªº AllType«á­±¨Ã¤£»Ý­n¦ê»²§U¦r¦ê

§ï°Ê«á¦p¤U
  1. Sub ss_teswt()
  2.     alltype = Array("AÃþ", "BÃþ", "CÃþ", "DÃþ", "EÃþ", "FÃþ", "GÃþ", "HÃþ", "IÃþ", "JÃþ")
  3.     Aj = "JÃþ"
  4.     If UBound(Filter(alltype, Aj)) < 0 Then
  5.         Debug.Print "Empty"
  6.     Else
  7.         Debug.Print UBound(Split(Split(" " & Join(alltype, "|"), Aj)(0), "|"))
  8.     End If
  9.     'Stop
  10. End Sub
½Æ»s¥N½X
ss

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-7-1 10:02 ½s¿è

¦^´_ 3# sunnyso
§PÂ_§¹¥þµ¥©ó¸Óelement¦b°}¦C¤¤¦ì¸m
  1. Sub Ex()
  2.     Dim S As String, alltype(), Aj As String, Ar  As String
  3.     S = ","                           '»²§U¦r¦ê
  4.     alltype = Array("AÃþ", "BÃþ", "DECÃþ", "ECÃþ", "CÃþ", "FÃþ", "GÃþ", "HÃþ", "IÃþ", "JÃþ")
  5.     Aj = S & "CÃþ" & S
  6.     Ar = S & Join(alltype, S) & S
  7.     If InStr(Ar, Aj) = 0 Then
  8.         Debug.Print "Empty"
  9.     Else
  10.        Ar = Split(Ar, Aj)(0)
  11.        Debug.Print IIf(UBound(Split(Ar, S)) < 0, 0, UBound(Split(Ar, S)))
  12.     End If
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  sunnyso

§PÂ_¸Óelement¦b°}¦C¤¤¦ì¸m
Debug.Print UBound(Split(Split(Join(alltype, "|"), aj)( ...
sunnyso µoªí©ó 2013-6-30 23:11


¼Ó¤W¦³bug¡A§ï爲
  1.     If UBound(Filter(alltype, aj)) < 0 Then
  2.         Debug.Print "Empty"
  3.     Else
  4.         Debug.Print UBound(Split(Split(¡§ ¡¨ & Join(alltype, "|"), aj)(0), "|"))
  5.     End If
½Æ»s¥N½X
ss

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD