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

±a¥X¹ïÀ³­È

¦^´_ 10# PJChen

TEXT(???,"¥¿¼Æ;­t¼Æ;¹s;¤å¦r")

TEXT(IF(B4:E4="",-1,B4:E4),"1;;1;!1")
ªÅ®æ--Âন-1
¥¿¼Æ¥H1ªí¥Ü, ­t¼Æ"", ¹s¥H1ªí¥Ü, ¤å¦r¥H1ªí¥Ü

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-1-5 15:09 ½s¿è

¦^´_ 6# PJChen


    ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
¤µ¤Ñ¾Ç²ß http://forum.twbts.com/thread-23571-1-1.html  ¦¹©«ªì¦¸¾Ç¨ìSwitch ¨ç¼Æ,
«á¾ÇÂǦ¹©«½m²ßVBA Switch ¨ç¼Æ,½Ð°Ñ¦Ò
ÁÂÁ ­ã´£³¡ªL«e½ú

°õ¦æ«e:


°õ¦æµ²ªG:


Option Explicit
Sub ±a¥X¹ïÀ³­È_1()
Dim Brr, i&, j&, K%, S$
Brr = Range([¤ñµá¦h!Q4], [¤ñµá¦h!A65536].End(3))
For i = 1 To UBound(Brr)
   ReDim T(1 To 5)
   For j = 1 To 5
      T(j) = Val(Replace(Brr(i, j), "W", 1))
   Next
   K = Switch(T(2) > 0, 6, T(3) > 0, 9, T(4) > 0, 12, T(5) > 0, 15, T(1) > 0, 1)
   Brr(i, 1) = Brr(i, K)
Next
[W:W].ClearContents
[¤ñµá¦h!W4].Resize(UBound(Brr), 1) = Brr
Set Brr = Nothing: Erase T
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD