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

[µo°Ý] ¦p¦ó§Q¥ÎVBA§R°£¦r¦ê«e«áªº¼Æ¦r©Î­^¤å¦r¦ê

¦^´_ 1# jsleee


   

Function test(s As String) As String
    Dim reg As Object
    Set reg = CreateObject("vbscript.regexp")
    With reg
        .Global = True
        .Pattern = "[A-Za-z0-9]+"
        test = .Replace(s, "")
    End With
End Function

TOP

¦^´_ 3# jsleee

¼¶¼g¨ç¦¡µ{¦¡
https://learn.microsoft.com/zh-tw/office/vba/language/concepts/getting-started/writing-a-function-procedure
    Function test(s As String) As String
    ©w¸q
    Dim reg As Object
¥¿³Wªí¥Ü¦¡ª«¥ó
    Set reg = CreateObject("vbscript.regexp")

    With reg
¥þ§½¤Ç°t¼Ò¦¡
        .Global = True
¤Ç°t¼Ò¦¡ ¤j¤p¼ga~z¡A¼Æ¦r 0~9
        .Pattern = "[A-Za-z0-9]+"
§â¤j¤p¼ga~z¡A¼Æ¦r 0~9¡A¥ÎªÅ¥Õ¨ú¥N
        test = .Replace(s, "")
    End With
End Function

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD