VBA¦p¦ó§â¦r¦ê¤¤ªº^¤å¦r«e´¡¤JªÅ®æ?
- ©«¤l
- 97
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 129
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2019-5-7
- ³Ì«áµn¿ý
- 2022-8-25
|
VBA¦p¦ó§â¦r¦ê¤¤ªº^¤å¦r«e´¡¤JªÅ®æ?
½Ð°ÝVBAn¦p¦ó¦b¦P¤@Àx¦s®æ¤¤¡A¦b^¤å¦rªº«e±´¡¤JªÅ®æ?
¦p¤U¹Ï¥ªÃä³B²z«e¡A¥kÃä³B²z«á¡C
|
|
|
|
|
|
|
- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 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
|
|
|
|
|
- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 12# ã´£³¡ªL
ÁÂÁ «e½ú«ü¾É |
|
|
|
|
|
|
- ©«¤l
- 2839
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2895
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-12-27
|
¦^´_ 2# Andy2483
If Mid(j, x, 1) Like "[A-z]" Then ¤j¤p³q¦Y~~ |
|
|
|
|
|
|
- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-12-18
|
¦^´_ samwang
½Ð°ÝArrn«ç¼Ë¤~¯à§ì¸ó¦æªº¸ê®Æ©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 |
|
|
|
|
|
|
- ©«¤l
- 97
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 129
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2019-5-7
- ³Ì«áµn¿ý
- 2022-8-25
|
¦^´_ 9# Andy2483
«D±`·PÁÂ~¨Ï¥Î°_¨Ó¨S¦³°ÝÃD!!! |
|
|
|
|
|
|
- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 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 |
|
|
|
|
|
|
- ©«¤l
- 97
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 129
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2019-5-7
- ³Ì«áµn¿ý
- 2022-8-25
|
¦^´_ 6# samwang
½Ð°ÝArrn«ç¼Ë¤~¯à§ì¸ó¦æªº¸ê®Æ©O?
¦]¬°¦b³o¦æ´N¥X¿ù¤F |
|
|
|
|
|
|
- ©«¤l
- 1392
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 1402
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-9-11
- ³Ì«áµn¿ý
- 2024-12-28
|
|
google"EXCEL°g" blog ©Îgoogleºô§}:https://hcm19522.blogspot.com/
|
|
|
|
|
- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-12-18
|
¥»©«³Ì«á¥Ñ samwang ©ó 2022-8-25 09:38 ½s¿è
¦^´_ samwang
¦]¬°§Ú³oÓ¬On³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ÁÂÁ |
|
|
|
|
|
|