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

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

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

½Ð°ÝVBA­n¦p¦ó¦b¦P¤@Àx¦s®æ¤¤¡A¦b­^¤å¦rªº«e­±´¡¤JªÅ®æ?
¦p¤U¹Ï¥ªÃä³B²z«e¡A¥kÃä³B²z«á¡C

Â^¨ú.JPG

¦^´_ 1# s13030029


    ½Ð«e½ú¸Õ¸Õ¬Ý

Option Explicit
Sub test()
Dim Arr, i, x, T, j$, c
Arr = Range([A1], [A65536].End(3))
For i = 1 To UBound(Arr)
   j = Trim(Arr(i, 1))
   c = Len(j)
   For x = c To 2 Step -1
      If UCase(Mid(j, x, 1)) Like "[A-Z]" Then
         j = Trim(Mid(j, 1, x - 1)) & " " & Mid(j, x, c * 2)
      End If
   Next
   Arr(i, 1) = j
Next
[B1].Resize(UBound(Arr), 1) = Arr
End Sub

TOP

¦^´_ 1# s13030029

½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ

Sub test()
Dim Arr, i, x, T, j$, c
Arr = Range([A1], [A65536].End(3))
For i = 1 To UBound(Arr)
    j = Trim(Arr(i, 1))
    c = Len(j)
    For x = c To 2 Step -1
        T = UCase(Mid(j, x, 1))
        If Asc(T) > 64 And Asc(T) < 123 Then
            Arr(i, 1) = Replace(Arr(i, 1), T, " " & T)
        End If
   Next
Next
[B1].Resize(UBound(Arr), 1) = Arr
End Sub

TOP

¥»©«³Ì«á¥Ñ s13030029 ©ó 2022-8-25 08:41 ½s¿è

¦^´_ 2# Andy2483
¦]¬°§Ú³o­Ó¬O­n³B²z¦P¤@Àx¦s®æ¤¤ªº¦r¦ê¡A¦Ó¥BÁÙ¦³´«¦æ¡A©Ò¥H¦bArrªº¦a¤è·|¦³¥X¿ù¡C
Â^¨ú.JPG

TOP

¥»©«³Ì«á¥Ñ s13030029 ©ó 2022-8-25 08:41 ½s¿è

¦^´_ 3# samwang
¦]¬°§Ú³o­Ó¬O­n³B²z¦P¤@Àx¦s®æ¤¤ªº¦r¦ê¡A¦Ó¥BÁÙ¦³´«¦æ¡A©Ò¥H¦bArrªº¦a¤è·|¦³¥X¿ù¡C
Â^¨ú.JPG

TOP

¥»©«³Ì«á¥Ñ samwang ©ó 2022-8-25 09:38 ½s¿è
¦^´_  samwang
¦]¬°§Ú³o­Ó¬O­n³B²z¦P¤@Àx¦s®æ¤¤ªº¦r¦ê¡A¦Ó¥BÁÙ¦³´«¦æ¡A©Ò¥H¦bArrªº¦a¤è·|¦³¥X¿ù¡C
s13030029 µoªí©ó 2022-8-25 08:38


Arr = Range([A1], [A65536].End(3)) §ï¦¨ Arr = [a1]¡Afor ´`Àô²¾°£¡AÁÙ¦³...¡A¥i¥H¸ÕµÛ§ï¬Ý¬Ý¡A¦³°ÝÃD¦A´£¥X¡AÁÂÁÂ

TOP

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

¦^´_ 6# samwang
½Ð°ÝArr­n«ç¼Ë¤~¯à§ì¸ó¦æªº¸ê®Æ©O?
¦]¬°¦b³o¦æ´N¥X¿ù¤F

TOP

¦^´_ 8# s13030029


    ÁÂÁ«e½úµoªí¦¹¥DÃD,½Ð«e½ú¦A¸Õ¸Õ¬Ý
ÁÂÁ samwang «e½ú «ü¾É
«á¾Ç»{ÃѤF Asc»PChr ªºÃö«Y,
«á¾Ç¹ï¦r¨åÆ[©ÀÁ¡®z ÂǦ¹²ß±o§â¦r¤¸­Ë¤J¦r¨å¤¤
½Ð«e½ú¦A«ü¾É!

Option Explicit
Sub test4() '³æ¦C©Î¦h¦C³£¥i¥H¥Î
Dim Arr, i, x, j$, c, d, xD, T
Arr = Range([A1], [A65536].End(3).Offset(1, 0))
Set xD = CreateObject("Scripting.Dictionary")
For d = 65 To 122 '65~90¬O¤j¼g 97~122¬O¤p¼g
   xD(d) = Chr(d)
   If d = 90 Then d = 96
Next
T = Join(xD.items, "//")
For i = 1 To UBound(Arr) - 1
   j = Arr(i, 1)
   j = Replace(Replace(j, " ", ""), "¡@", "") '¥h°£ªÅ¥Õ¦r¤¸
   c = Len(j)
   For x = c To 2 Step -1
      If InStr(T, Mid(j, x, 1)) And Mid(j, x - 1, 1) <> vbLf Then
         j = Mid(j, 1, x - 1) & " " & Mid(j, x, c * 2)
      End If
   Next
   Arr(i, 1) = j
Next
[B1].Resize(UBound(Arr) - 1, 1) = Arr
Set Arr = Nothing
End Sub

TOP

¦^´_ 9# Andy2483
«D±`·PÁÂ~¨Ï¥Î°_¨Ó¨S¦³°ÝÃD!!!

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD