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

½Ð±Ðmid¡Bmidb¡Blen¡Blenb°ÝÃD

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-1-20 22:50 ½s¿è

µ¹­Ó°Ñ¦Ò¤èªk¡ã¡ã¡ã

¢Ï¢°©ñ¢´¢¯¢±­Ó¦r¤¸¤å¦r¦ê·í´ú¸Õ¡A
¡@
Sub ºI¨ú¦r¦ê()
Dim Arr
Arr = SPT_Str([A1], 20)
Arr = Split(Arr, Chr(10))
[H4].Resize(UBound(Arr) + 1) = Application.Transpose(Arr)
End Sub
¡@
'¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×
Function SPT_Str(xString$, xLength%)
Dim T$, TT$, TTT$, LN&
TT = xString
Do
¡@¡@T = Evaluate("MIDB(""" & Left(TT, 240) & """,1," & xLength & ")")
¡@¡@LN = Len(T)
¡@¡@If Right(T, 1) = " " And Mid(TT, LN) <> " " Then LN = LN - 1
¡@¡@TTT = TTT & Chr(10) & Left(TT, LN)
¡@¡@TT = Mid(TT, LN + 1)
Loop Until TT = ""
SPT_Str = Mid(TTT, 2)
End Function
¡@
Left(TT, 240)¡@
¡Ä¦r¦ê¤Óªø¡AMIDB ·|µo¥Í¿ù»~¡A©Ò¥H¥ýºI¨ú«e­±¢±¢³¢¯­Ó¦r¤¸¡I

If Right(T, 1) = " " And Mid(TT, LN) <> " " Then LN = LN - 1¡@
¡ÄºI¨ú¤å¦r³Ì«á¤@¦r­Y¬°¡eªÅ¥Õ¦r¤¸¡f¡A§PÂ_¬O§_¬°¥þ«¬¦r¥¼§¹¥þ¨ú¥Xªº¾l¥Õ¡A­Y¬O¡A«h´î¨ú¤@¦r¡I
¡@
´ú¸ÕÀÉ¡G
20160120-01(ºI¨ú¦r¦ê).rar (9.2 KB)
¡@

TOP

¦^´_ 13# lionliu


¥H =MIDB("Ya Xing 123456789¤¤¤@¤M",1,20) ¬°¨Ò,
¨ú¥X¦r¦ê¬° "Ya Xing 123456789¤¤ " , "¤@" ­è¦n¦b 20,21 ¦ì¸m, ³QºIÂ_¥u¨ú¤@¥b, ©Ò¥H¦r¦ê«á­±¦h¤F¤@­Ó[ªÅ¥Õ¦r¤¸],
ÁöµM¥i¥Î TRIM ¥h°£ªÅ¥Õ¦r¤¸, ¦ý­Y¹J¨ì¨ú¥X¦r¦êªº«e«áªÅ¥Õ¬O­ì¦r¦ê©Ò¦³, ¦¹®É TRIM ·|Åýµ²ªG¥¢¯u,
¦]¦¹¥H¤Wªº LENB, MIDB ³£µLªk¥¿½T¨ú¥Xµ²ªG!

©Î³\Á|¥X¤@­Ó¸ûªø¦r¦ê¹ê¨Ò, ¨Ã¤â°Ê±N»Ý¨Dµ²ªG¦C¥X, ¦A¨Ó·Q¿ìªk!!!

TOP

¦^´_ 12# ML089
¦^´_ 12# ­ã´£³¡ªL
ÁÂÁÂ2¬°ª©¤j«ü¾É
§Ú²{¦b²×©óª¾¹D°ÝÃD©Ò¦b¤F¡A§Ú¦A§V¤O¸Õ¸Õ¬Ý¥i§_§PÂ_¨C¦¸¨ú¥X¦r¦êªø«×¡C
§Úªº­ì©l¸ê®ÆµLªk¥¿½T´£¨Ñ¡A¦]¬°¤£½T©w©Ê¦³­^¼Æ¡BªÅ¥Õ¡B¤¤¤å«Ü¶Ãªøµu¤£¤@¡A³Ì¦h¥i¥H¨ì200bye¥H¤W¡C
¦b³oÁÙ¬OÁÂÁÂ2¦ì¼ö¤ßªº±Ð¾É¡C
lionliu

TOP

¦^´_ 10# lionliu

§â­ã¤jªº¤½¦¡§ï¬°¦Û­q¨ç¼Æ
Function xMidB(ByVal str As String, start, length)
    xMidB = Evaluate("MidB(""" & str & """," & start & ", " & length & ")")
End Function

Function xLenB(ByVal str As String)
    xLenB = Evaluate("LenB(""" & str & """)")
End Function
   

¦A¨Ó´N¬O¨ú¥Îªº¸ê®Æ³W«h
¨C20­Ó¦r¨ú¤@¬q¡A­Y¤¤¤å¦r¦b²Ä20­Ó¦r¦ì¸m¡A¥ÎEvaluate¨Ó¨Ï¥Îªí¨ç¼Æ®É·|¦Û°Ê¨ú¬°21­Ó¦r¤¸¡A«O«ù¤¤¤å¦rªº§¹¾ã©Ê¡C¦ý¤U¤@¬q¬O­n¨ú20­Ó¦r©Î19­Ó¦r­n¥ý©w¸q²M·¡¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 10# lionliu


¤£­n¥Î MIDB¡A¥ý¥H¤u§@ªí¤½¦¡°Ñ¦Ò¥H¤U¡G
¢Ï¢°¡Gasxing¤¤¤@¤M
¢Ð¢°¡G=LEFT(A1,LEN(A1)*2-LENB(A1))¡@¨ú«e¬q¥b«¬¦r
¢Ñ¢°¡G=RIGHT(A1,LENB(A1)-LEN(A1))¡@¨ú«á¬q¥þ«¬¦r
¡@¡@¡@©Î¡@=MID(A1,LEN(A1)*2-LENB(A1)+1,99)

¦pªG¤å¦r¦ê¤£¬O³æ¯Âªº¨â¬q¦¡¡A¤èªk´N½ÆÂø¦h¤F¡A­n¬Ý¹ê»Ú¸ê®Æ¤Î»Ý¨D¦p¦ó¡H

TOP

¥»©«³Ì«á¥Ñ lionliu ©ó 2016-1-19 15:30 ½s¿è

¦^´_ 6# ML089
¦^´_ 8# ­ã´£³¡ªL
2¦ì¤j­ô¦n¡G
¸g¹L´ú¸Õ«áµo²{2­Ó°ÝÃD¡Amj¤j¤jªº¤èªk­Y¤¤¤å¦r¦ê­è¦n¦b¤Á³ÎÂI·|Åܦ¨?¡A¤U¤@¦æ²Ä¤@®æ¦r¤]¬O?¡A¤¤¤å¦r­å¥b¡C

­ã¤jªº¤èªk§Ú²Ä¤@¦¸¥Îmidb¤£·|§ï¡A§Ú¹L§Ú¥Î¤FÃþ¦¡ªº²Â¤èªk¡A"=midb(a1,1,20)"¥´¤½¦¡ªº¤è¦¡¡Aµ²ªG·|¦n¤@ÂI¡A¦ý¬Oµo²{·|±¼¦r(¤¤¤å¦r­è¦n¦b¤À³ÎÂI®É)¡A¥Ø«e©|¦b¬ã¨s´ú¸Õ¤¤¡C
lionliu

TOP

¦^´_ 6# ML089
ÁÂÁÂMJ¤j¤j¡G
§Ú´ú¸Õ«á³£¥¿±`¤F¡C
lionliu

TOP

¦^´_ 7# ­ã´£³¡ªL
ÁÂÁ Mj»P­ã¤j2¦ì¤j­ôªº¦^ÂСA­ì¨ÓmedbÁÙ­n³o¼Ë§ï¡A§Ú·Q»¡¤@ª½¥X²{¶Ã½X¤£ª¾­þ¨½¥X¿ù¥¿·Q¦A½Ð±Ð¡C§Ú¦A¸Õ¬Ý¬Ý¡C
lionliu

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-1-18 15:45 ½s¿è

¸û²³æªº¤èªk¡G
xLenB = Evaluate("LenB(""" & Range("A1") & """)")
MsgBox xLenB

­Y¤¤¤å§t¦³¡e²Åé¦r¡f©Î¨ä¥¦¥~¦r½X¥þ«¬¦r¡AxLenB ·|¶Ç¦^¢°¡A©Ò¥HÁÙ¬O¤£¥i¾a¡A
¨Ò¦p¡G堃¡D々¡D国¡D龥....µ¥µ¥

¥i¦Ò¼{¡e¥¿«h¡f¤èªk¡A¦ý§Ú¤£¼ô¥Î¡A½Ð¤Wºô§ä²{¦¨¬Ý¬Ý¡ã¡ã

TOP

¥[¤J
Function xMidB(ByVal str As String, start, length)
    xMidB = StrConv(MidB(StrConv(str, vbFromUnicode), start, length), vbUnicode)
End Function

Function xLenB(ByVal str As String)
    xLenB = LenB(StrConv(str, vbFromUnicode))
End Function

±N­ìµ{¦¡¤¤ªº LenB §ï¬° xLenB
±N­ìµ{¦¡¤¤ªº MidB §ï¬° xMidB
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD