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

¥u¨ú¥X¦r¦ê¤¤ªº¤¤¤å¦r¤¸

¥u¨ú¥X¦r¦ê¤¤ªº¤¤¤å¦r¤¸

¦r¦ê¤¤¥i¯à¥]§t ¤¤¤å ­^¤å ¼ÐÂI ªÅ®æ,¯à¤£¯à¥u¨ú¥X¨ä¤¤ªº¤¤¤å,¦p"3D. °¶¤j(¤¤¤åª©)">>>>>"°¶¤j¤¤¤åª©"
½Ð±Ð¦U¦ì«e½ú.
lmh

A1="3D. °¶¤j(¤¤¤åª©)"
B1=IF(LENB(MID($A1,COLUMN()-1,1))=2,MID($A1,COLUMN()-1,1),"")&C1
B1¤½¦¡¥k©Ô½Æ»s(¥k©Ô®æ¼Æ¬°¦r¦ê³Ì¤jªø«×)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦hÁ«ü±Ð,¥k©Ô¨ú±oµ²ªG,¥H«e¨S¸Õ¹L,§Ú¥Îvb¥k©Ô20®æ,³o20®æ¬OÁôÂêº,©Ò¥HBÄæ¨ú±o§Ú­nªºµ²ªG,¤Q¤À·P¿E§A
lmh

TOP

³B²z¤å¦r¨S¦³°}¦C²Õ¦X¨ç¼Æ¡A©Ò¥H§Q¥Î¥k©Ô¦h®æ¤½¦¡¨Ó¦X¨Ö³B²z
­Y§A¥ÎVBA´N¤£¥Î¨º»ò¨¯­W
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦A½Ð±Ðvb¨½lenb¦p¦ó¥Î?
vb¨½ lenb(3)¥X¿ù,lenb("3")=2,¦ó¸Ñ?
lmh

TOP

°ÝÃD¸Ñ¨M¤F
Function ZW(A)
For i = 1 To Len(A)
If LenB(StrConv(Mid(A, i, 1), &H80)) = 2 Then
    zw2 = zw2 & Mid(A, i, 1)
End If
Next i
ZW = zw2
End Function
ÁÙ¬O­nÁÂÁ§A
lmh

TOP

Function ZW(A)
For i = 1 To Len(A)
If LenB(StrConv(Mid(A, i, 1), &H80)) = 2 Then
    zw2 = zw2 & Mid(A, i, 1)
End If
Next i
ZW = zw2
End Function

®³±¼ StrConv ¨ç¼Æ¦p¤U¡A°õ¦æ´N¤£¹ï¡AWHY?

Function ZW1(A)
ZW = ""
For i = 1 To Len(A)
If LenB(Mid(A, i, 1)) = 2 Then
    ZW = ZW & Mid(A, i, 1)
End If
Next i
End Function
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¥»©«³Ì«á¥Ñ mhl9mhl9 ©ó 2013-8-10 00:50 ½s¿è

§Ú¬O¬Ý¨ì¥H¤U¨â¬qª¾¹Dvba¨½lenb©Mexcelªºlenb¤£¦P
VBA¤¤¡GLenB ªð¦^ªº¬O¥Î¤_¥Nªí¦r²Å¦êªº¦r节数¡A¦Ó¤£¬Oªð¦^¦r²Å¦ê¤¤¦r²Åªº数¶q¡C
¦Ó¦b¤u§@ªí¡A结ªG¦ü¥Gªí©ú汉¦r当双¦r节¦Ó¦r¥À©M数¦r当单¦r节处²zªº¡C

Function LenMbcs(ByVal str As String)
    LenMbcs = LenB(StrConv(str, vbFromUnicode))
End Function
Sub yyy()
a = LenMbcs("¼Babc")
End Sub
a=5------(2+3)
lmh

TOP

{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¥Î ¡§¥¿³Wªí¥Ü¦¡¡¨

Function CountDblChr(ByVal sCh As String) As Integer

    Set re = CreateObject("vbscript.regexp")

    're.Pattern = "[\u4e00-\u9fa5]" '§PÂ_¤¤¤å¦r(¥]¬A¯S®í¦r¡A¦ý¤£¥]¬A²Å¸¹¡C©M¼Æ¦r¦p¢°¡^

    re.Pattern = "[^\x00-\xff]" '§PÂ_©Ò¦³ªº¥þ§Î¦r

    re.Global = True

    re.IgnoreCase = True

    Set matches = re.Execute(sCh)

    CountDblChr = matches.Count

    Set re = Nothing

End Function
ss

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD