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

[µo°Ý] Àx¦s®æ¦r¦êªø«×¤j©ó255

¦^´_ 4# a77261988
  1. Option Explicit
  2. Sub Ex()
  3. Dim W As Variant, xi As Integer
  4.     W = "1aaaaaaaa-aaaaa-aaa-2aa-aa-a-3a-aaaaa-aaa-4aa-aa-a-a-aaaaa- aaa - aa - aa - a - a - aaaaa - aaa - aa - aa - a - a - aaaaa - aaa - aa - aa - a - a - aaaaa- aaa - aa - aa - a - a - aaaaa - aaa - aa - aa - a - a - aaaaa - aaa - aa - aa-a-a-aaaaa- aa -aa - aa - a - a - aaaaa - aaa - aa - aa - a - a - aaaaa - aaa - aa - aa - a - a - aaaaa - aaa - aa - aa - a - a"
  5.     W = Replace(W, "-", "-,")
  6.     W = Split(W, ",")
  7.     For xi = 2 To UBound(W) Step 3
  8.         W(xi) = W(xi) & Chr(10)
  9.     Next
  10.     [a1] = Join(W, Chr(10))
  11. End Sub
½Æ»s¥N½X

TOP

³o¼Ë¾ã²z¤£¬OÅã±o§ó¶Ã¡H
  1. Sub yy()
  2.     For r = 1 To [d1000].End(3).Row
  3.         w = Cells(r, 4).Value
  4.         For i = 1 To Len(w)
  5.             If Mid(w, i, 1) = "-" Then
  6.                 j = j + 1
  7.                 If j = 3 Then
  8.                     Mid(w, i, 1) = ",": j = 0
  9.                 End If
  10.             End If
  11.         Next
  12.         Cells(r, 4) = Trim(Replace(w, ",", "-" & vbLf))
  13.     Next
  14. End Sub
½Æ»s¥N½X

TOP

oobird¤j­ô,¦]¬°­ì¥»ªº¸ê®Æ§ó¦h§óªø,
»Ý­n³z¹L¥Ñ´X­Ó²Å¸¹´«¦æ¨ÓÀ˵ø¸ê®Æ,©Ò¥H¦³³o­Ó»Ý¨D,
µ{¦¡§¹¥þ¹F¨ì§Úªº»Ý¨D,«D±`ªº·PÁ§A,
¦ý¬O¦³¤@­ÓºÃ°Ý´N¬O,·í¸ê®Æ¾ã²z§¹¤§«á,
±NÀx¦s®æ©Ô¶},«e­±·|¦³«Ü¦hªÅ¥Õ³B,³o¬O¤°»ò­ì¦]©O?

TOP

¤£·|¦³ªÅ¥Õªº¡A¥þ¿ï~§â®æ¦¡~¹ï»ô¤è¦¡¿ï"¾a¤W¹ï»ô"¡A«e­±´N¤£·|ªÅ¤F¡I
µ{¦¡½X®M¥ÎGBKEEª©¥Dªº¥N½X®Ä²v·|§ó°ª¡G
  1. Sub yy()
  2.     For r = 1 To [d1000].End(3).Row
  3.         W = Cells(r, 4).Value
  4.         W = Replace(W, "-", "-,")
  5.         W = Split(W, ",")
  6.         For xi = 2 To UBound(W) Step 3
  7.             W(xi) = W(xi) & Chr(10)
  8.         Next
  9.         Cells(r, 4) = Trim(Join(W))
  10.     Next
  11. End Sub
½Æ»s¥N½X

TOP

oobird¤j­ô,¦A½Ð°Ý¤@¤U,¦³¿ìªk±N©T©wªº[d1000]Åܦ¨·Æ¹«ÂI¿ïªº¾ã¦Ccolumn¶Ü?

TOP

¦^´_ 15# a77261988
  1. Sub nn()
  2. Dim A As Range, i%, s%
  3. If Application.CountA(Selection.EntireColumn) = 0 Then Exit Sub 'ÁקKÄæ¦ìµL¸ê®Æ
  4. For Each A In Selection.EntireColumn.SpecialCells(xlCellTypeConstants)
  5. i = 0: s = 0: A = Application.WorksheetFunction.Substitute(A, Chr(10), "") '¨ú®ø´«¦æ²Å¸¹
  6. Do Until InStr(Mid(A, i + 1), "-") = 0
  7.   i = InStr(i + 1, A, "-")
  8.   s = s + 1
  9.   If s Mod 3 = 0 Then A = Application.WorksheetFunction.Replace(A, i, 1, "-" & Chr(10))
  10. Loop
  11. Next
  12. Selection.EntireColumn.AutoFit
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁ¦U¦ì¤j­ô!

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD