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

[µo°Ý] vba·s¤âµo°Ý

[µo°Ý] vba·s¤âµo°Ý

½Ð°Ý§Ú¼g¤F¤@­Ó°ò¥»ªºif°j°é¡A­n«ç»òÅý§PÂ_ªºµ²ªG¸òµÛ¸ê®Æ¨Ó·½²¾°Ê

ÁÂÁÂ

¬¡­¶Ã¯1.rar (20.22 KB)

¦^´_ 15# ­ã´£³¡ªL


«z~­ã¤j³o­Óswitch§ó²¼ä~ÁÂÁÂ

TOP

¦^´_ 14# ML089


¤F¸Ñ~
ÁÂÁÂML089¤j¤j~

TOP

¦^´_ 13# samwang


·PÁÂsamwang¤j¤j ¸Ñµª~

TOP

Sub iif3()
    Dim arr, i&,V,T$
    arr = Range([a20], [a65536].End(3))
    For i = 1 To UBound(arr)
         v= arr(i,1)
         t=switch(v>=100,"³q¹L",v>=0,"¤£³q¹L",v=v,"")
         arr(i, 1) = t
    Next
    [c20].Resize(UBound(arr)) = arr
End Sub

TOP

¦^´_  ML089

ÁÂÁÂML089¤j¤j~
    Select Case¥Î³~¦³¤ñ¸û¼s¶Ü¡H
wayne0303 µoªí©ó 2021-9-7 17:55


­Y¬O¤@­ÓÅܼƥu¦³2~3ºØ§PÂ_¡A¥Î IF ¤ñ¸û²³æ¡A3­Ó¥H¤W§PÂ_¥i¥H¦Ò¼{¥Î Select Case
¹³¤U¦C½d¨Ò¤§¦h¶µ§PÂ_¥ÎIF´N«Ü²Ö§a!

Select Case number
    Case 1 To 5
        Debug.WriteLine("Between 1 and 5, inclusive")
        ' The following is the only Case clause that evaluates to True.
    Case 6, 7, 8
        Debug.WriteLine("Between 6 and 8, inclusive")
    Case 9 To 10
        Debug.WriteLine("Equal to 9 or 10")
    Case Else
        Debug.WriteLine("Not between 1 and 10, inclusive")
End Select
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 12# wayne0303


Select Case¥Î³~¦³¤ñ¸û¼s¶Ü¡H
>> Select Case ©M if elseif¡A»yªk¼gªk¤£¤Ó¤@¼Ë¡A¦ý¹ê»Úµ²ªG¬O¤@¼Ëªº¡A¬Ý­Ó¤H³ß¦n¨Ï¥Î¡A·PÁ¡C

TOP

¦^´_ 11# ML089

ÁÂÁÂML089¤j¤j~
    Select Case¥Î³~¦³¤ñ¸û¼s¶Ü¡H

TOP

Select Case  ¨Ó´À¥N If else
Sub iif4()
    Dim arr, i
    arr = Range([a20], [a65536].End(3))
    For i = 1 To UBound(arr)
        Select Case arr(i, 1)
        Case Is >= 100
            arr(i, 1) = "³q¹L"
        Case Is >= 0
            arr(i, 1) = "¤£³q¹L"
        Case Else
            arr(i, 1) = ""
        End Select
    Next
    [c20].Resize(UBound(arr)) = arr
End Sub
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 9# ML089


S = S + 1 ¬O¦h¾lªº
«x~¥i¥H吔¡AÁÂÁÂML089¤j¤j«ü¾É

Sub iif2()
    Dim arr, i
    arr = Range([a20], [a65536].End(3))
    For i ...
ML089 µoªí©ó 2021-9-7 14:08

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD