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

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

¦^´_ 20# lionliu


½d¨ÒÀɪº¡e¨ç¼Æ¡f©Î¡eVBA¡f¨âªk¡A³£¦³¤¤¤å¦r¡e±¼¦r¡f°ÝÃD¡A
¡­¢°¢´µ{¦¡µy­×¦p¤U¡G
Sub ºI¨ú¦r¦ê()
Dim Arr
Arr = SPT_Str(Replace([A2], Chr(10), ""), 20)¡@
Arr = Split(Arr, Chr(10))
[B6].Resize(UBound(Arr) + 1) = Application.Transpose(Arr)
End Sub

¡e¦Û­q¨ç¼Æ¡fFunction SPT_Str(xString$, xLength%)¡@¤£ÅÜ¡I

§¹¥þ¤£·|¦³¡e±¼¦r¡þ®t¦r¡f°ÝÃD¡ã¡ã¡ã

TOP

¦^´_ 21# ­ã´£³¡ªL
ÁÂÁ­ã¤j
À°§Ú§â³o§xÂZ§Ú«Ü¤[ªº°ÝÃD¸Ñ¨M¤F
¡A§Ú¦A¥J²Óªº¬ã¨s¤@©w­n·dÀ´¥L¡C
lionliu

TOP

¥»©«³Ì«á¥Ñ ML089 ©ó 2016-1-24 23:16 ½s¿è

¦^´_ 20# lionliu
­ì©l³Æµù¬O¥HCHAR(13)&CHAR(10)µ²§À¡A­Y­n­«·s¤À¹j¬°20¦r¤¸®É¡ACHAR(13)&CHAR(10)µ²§À¥Î "," ¨Ó´À¥N·|¤ñ¦n¡C


¤@¡B±Ä¥Î¨ç¼Æ¤½¦¡¤èªk
¦WºÙ¤½¦¡
find_text =MIDB(STR,LOOKUP(999,IF({1,0},1,FINDB(INDIRECT("R[-1]C",),STR)+LENB(INDIRECT("R[-1]C",)))),{19;20})
STR =SUBSTITUTE(!$A$2,CHAR(13)&CHAR(10),",")

C6¤½¦¡
C6 =IF(AND(ROW(A1)>1,INDIRECT("R[-1]C",)=""),"",LOOKUP(,0/FINDB(find_text,STR),find_text))

¤½¦¡¨ä¥LÀ³¥Î®É»Ý­n­×§ï ¦WºÙ¤¤ªº $A$2¡A¨ä¥L¤£»Ý­n³B²z¡C


¤G¡B±Ä¥ÎVBA¤èªk
­É¥Î­ã¤jªºVBA­×§ï¦p¤U

Sub ºI¨ú¦r¦ê()
    Dim Arr
    Arr = SPL(Replace([A2], Chr(13) & Chr(10), ","), 20)
    Arr = Split(Arr, Chr(10))
    [H6].Resize(UBound(Arr)) = Application.Transpose(Arr)
End Sub

Function SPL(ByVal xS$, xL%)
    If xS = "" Then Exit Function
    nL = IIf(InStr(xS, xMidB(xS, 1, 20)), 20, 19)
    SPL = xMidB(xS, 1, nL) & Chr(10) & SPL(xMidB(xS, nL + 1, 9999), xL) '»¼¦^³B²z
End Function

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

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

¤T¡B±Ä¥Î¦Û­q¨ç¼Æ¤Î¦Û°Ê´«¦C¤è¦¡
=SPL(SUBSTITUTE($A$2,CHAR(13)&CHAR(10),","),20)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 23# ML089
ÁÂÁÂmlª©¥L¤jªº´£¿ô¡A Åý§Úªº¸ê®Æ¤ººa§ó³q¶¶¡C§Ú¦A¥J²Óªº¬ã¨s¤@¤U¡C
lionliu

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD