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

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

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

¦U¦ì¥ý¶i¦n¡A
½Ð±Ð¤@­Ó°ÝÃD¡A¦pªG§Ú¦³¦r¦ê¬O ¼Æ¦r+¤¤¤å¦r+­^¤å¦r
¦pªG§Ú·Q­n§â¤¤¤å¦rªº³¡¤À±q¦r¦ê¤¤¨ú¥X¨Ó¡A¤£ª¾¦³¬Æ»ò¤è¦¡¡H
¨Ò¦p¡G1100¤¤¤å¤¤¤å¤¤¤å...AABBCC¡A¥u·Q­n¨ú¥X "¤¤¤å¤¤¤å¤¤¤å..." ³o¬q¡A¸Ó¦p¦ó¼gµ{¦¡½X¡H
½Ð¥ý¶i¤£§[«ü¾É¡AÁÂÁÂ

JS

¦^´_ 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

¦^´_ 2# quickfixer    

quickfixer±z¦n
  ¤£ª¾¯à§_´£¨Ñ¤@¨Ç¸Ñ»¡¡A§Ú¤£¤Ó¯à²z¸Ñ±zªºµ{¦¡½X¡C
   ·P¿E¤£ºÉ¡AÁÂÁÂ
JS

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

¦^´_ 4# quickfixer


   quickfixer±z¦n
     ·PÁ±zªº«ü¾É¡A§Ú¦n¦n¬ã¨s¬ã¨s¡AÁÂÁÂ
   JS

TOP

ÁÂÁ¤G¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ßÂ^¨ú¥X¦r¦ê¶¡ªº³sÄò¤¤¤å,½Ð¦U¦ì«e½ú«ü±Ð

Option Explicit
Sub TEST()
Dim T$
T = "1100¤¤¤å¤¤¤å¤¤¤å...AABBCC"
T = Replace(1 & T, Val(1 & T), "")
MsgBox T
T = Mid(T, 1, Evaluate("LENB(""" & T & """)") - Len(T))
MsgBox T
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

(·j´M¿é¤J½s¸¹12593) googleºô§}:https://hcm19522.blogspot.com/
google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD