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

VBA¦p¦ó§â¦r¦ê¤¤ªº­^¤å¦r«e´¡¤JªÅ®æ?

¦^´_  samwang
½Ð°ÝArr­n«ç¼Ë¤~¯à§ì¸ó¦æªº¸ê®Æ©O?
¦]¬°¦b³o¦æ´N¥X¿ù¤F
s13030029 µoªí©ó 2022-8-25 10:29


½Ð¦A´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test()
Dim Arr, a, T, i&, x, j%
Arr = Range([A1], [A65536].End(3).Offset(1, 0))
For i = 1 To UBound(Arr) - 1
    a = Split(Trim(Arr(i, 1)), Chr(10))
    For x = 0 To UBound(a)
        For j = 2 To Len(a(x))
            T = UCase(Mid(a(x), j))
            If Asc(T) > 64 And Asc(T) < 123 Then
                If Cells(i, 2) = "" Then
                    Cells(i, 2) = Replace(a(x), T, " " & T)
                Else
                    Cells(i, 2) = Cells(i, 2) & Chr(10) & Replace(a(x), T, " " & T)
                End If
            End If
        Next
    Next
Next
End Sub

TOP

¦^´_ 2# Andy2483


If Mid(j, x, 1) Like "[A-z]" Then  ¤j¤p³q¦Y~~

TOP

¦^´_ 12# ­ã´£³¡ªL
    ÁÂÁ «e½ú«ü¾É

TOP

¦^´_ 2# Andy2483


    ­×¥¿¦Û¤vªº»{ª¾
j = Trim(Mid(j, 1, x - 1)) & " " & Mid(j, x, c * 2) §ï¬°
j = Trim(Mid(j, 1, x - 1)) & " " & Mid(j, x)§Y¥i
·íªì¾Ç²ß®ÉÁÙ¦b¦Ò¼{ length ­n¥Î¦h¤Ö??  

https://learn.microsoft.com/zh-tw/office/vba/language/reference/user-interface-help/mid-function
Mid(string, start, [ length ])
string        ¥²­n¡C ¦r¦ê¹Bºâ¦¡ªº¥\¯à¬O·|±q¤¤¶Ç¦^¦r¤¸¡C ¦pªG ¦r¦ê ¥]§t Null¡A«h¶Ç¦^ Null¡C
start        ¥²­n¡FLong¡C string ¤¤­nÂ^¨ú°µ¬°¶}©l³¡¤Àªº¦r¤¸¦ì¸m¡C ¦pªG start ¤¤ªº¦r¤¸¼Æ¤j©ó string¡A«h Mid ·|¶Ç¦^¹sªø«×¦r¦ê ("")¡C
length        ¿ï¥Î¡FVariant (Long)¡C ­n¶Ç¦^ªº¦r¤¸¼Æ¡C ¦pªG¬Ù²¤¦¹°Ñ¼Æ¡A©Î¬O¦r¤¸¼Æ¤Ö©ó¤å¦r¤¤ªº length ¦r¤¸ (¥]§t start ©Ò¦bªº¦r¤¸)¡A´N·|¶Ç¦^±q start ¦ì¸m¶}©l¤@ª½¨ì¦r¦êµ²§Àªº©Ò¦³¦r¤¸¡C
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD