ªð¦^¦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

¦^´_ 1# sunnyso

§PÂ_¸Óelement¦b°}¦C¤¤¦ì¸m
Debug.Print UBound(Split(Split(Join(alltype, "|"), aj)(0), "|")) + 1
  1.     If UBound(Filter(alltype, aj)) < 0 Then
  2.         Debug.Print "Empty"
  3.     Else
  4.         Debug.Print UBound(Split(Split(Join(alltype, "|"), aj)(0), "|")) + 1
  5.     End If
½Æ»s¥N½X
ss

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

¥»©«³Ì«á¥Ñ 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 ©ó 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: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

¦^´_ 6# GBKEE

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

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

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

TOP

¦^´_ 9# GBKEE

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

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD