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

¦r¦ê¤À³Î»P´«¦æ?

¦r¦ê¤À³Î»P´«¦æ?

¤p§Ì¦³¤@¦ê¦r¦ê¦p¤U¡G
111,222,333,444 aaa,bbb,ccc,ddd
¨ä¤¤444«á­±¦³¤@­ÓªÅ®æ¡A¤p§Ì·Q±N¦r¦ê¤À³Î¦p¹Ï

¦pªGª½±Æ¡A¸Ó«ç»ò¼g
¾î±Æ¡A¤S¸Ó«ç»ò¼g©O

ÁÂÁÂ

¤p§Ì·|¼gª½±Æ¤F¡A¤£¹L¼g±o¤£¦n¡A¤j®aÀ°§Ú¬Ý¬Ý
  1. Sub ¦r¦ê³B²z()
  2.     Dim aa As String
  3.     aa = Sheets(1).Cells(1, 1)
  4.     bb = Split(aa, " ")
  5.    
  6.     i = 1
  7.         For Each cc In bb
  8.         Sheets(1).Cells(i, 2) = cc
  9.         dd = Split(cc, ",")
  10.             j = 1
  11.             For Each ee In dd
  12.             Sheets(1).Cells(j, i + 2) = ee
  13.             j = j + 1
  14.             Next
  15.         i = i + 1
  16.         Next
  17. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-10-14 18:54 ½s¿è

¦^´_ 2# joey0415
½Ð°Ñ¦Ò°Ñ¦Ò
Sub Ex()
    Dim Rng As Range, A, B, W, E
    W = "111,222,333,444 AAAA,BBB,CCC,DDDD"
    A = Split(W, " ")  '¥HªÅ¥Õ¤À¸Ñ
    Set Rng = [A1]
    Rng.CurrentRegion = ""
    For Each E In A
        B = Split(E, ",")  '¥H , ¤À¸Ñ
       '''''''''''¾î±Æ
        Rng.Resize(1, UBound(B)+1) = B     '°}¦C¬O¾î±Æªº
        Set Rng = Rng.Offset(1)
        '''''''''''ª½±Æ
        'Rng.Resize(UBound(B)+1, 1) = Application.Transpose(B)  'TransposeÂà¸m¬°ª½±Æ
        'Set Rng = Rng.Offset(, 1)
    Next
End Sub

TOP

Sub Macro1()
t = [a1]
sp = Split(t, " ")
p1 = Split(sp(0), ",")
p2 = Split(sp(1), ",")
For i = 1 To 4
Cells(1, 2 + i) = p1(i - 1)
Cells(2, 2 + i) = p2(i - 1)
Cells(i, 8) = p1(i - 1)
Cells(i, 9) = p2(i - 1)
Next
End Sub

TOP

·PÁ¨â¦ìª©¥DÀ°¦£¡A¤p§ÌÀ³¸Ó·|¥Î¤F¡AÁÂÁÂ

TOP

³Ìªñ¦b¾Ç²ßVBA¡K¤W­zªºµ{¦¡³£¦³´ú¸Õ¡K
oobird ¤jªºµ{¦¡·|¥X²{    °}¦C¯Á¤Þ¶W¥X½d³ò ¿ù»~ 9
¤£ª¾¹D¬O¤£¬Oª©¥»ªº°ÝÃD¡K§Ú¨Ó§ä¨ì¤F³o½g
http://forum.twbts.com/redirect. ... amp;goto=nextoldset
­×§ï«áªºµ{¦¡¦p¤U¡K
Sub Macro1()
On Error Resume Next '¼W¥[µ{¦¡
t = [a1]
sp = Split(t, " ")
p1 = Split(sp(0), ",")
p2 = Split(sp(1), ",") '­×§ï«e·|¥X²{ °}¦C¯Á¤Þ¶W¥X½d³ò ¿ù»~ 9
For i = 1 To 4
Cells(1, 2 + i) = p1(i - 1)
Cells(2, 2 + i) = p2(i - 1)
Cells(i, 8) = p1(i - 1)
Cells(i, 9) = p2(i - 1)
Next
End Sub
º¸«áµ{¦¡´N¥¿±`¤F¡K·PÁÂ¥H¤W«e½ú´£¨Ñªº¾Ç²ß¸ê®Æ¡I
¨««æªº¤H¬Ý¤£¨£¦a¤Wªº°v¤l¡A ·Ð´oªº¤H¨É¨ü¤£¨ì©¯ºÖªº¤é¤l¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-6-26 10:08 ½s¿è

¦^´_ 6# lasum
Sub Macro1()
On Error Resume Next '¼W¥[µ{¦¡   '<- ³o¤£¬O¸Ñ¨M¤§¹D :   ¦pµ{¦¡¤¤ÁÙ¦³¿ù»~¬O·|§ä¤£¥X¨Óªº
t = [a1]                                                < ..°ÝÃD¬O³o¦r¦ê¤¤  ¦p¨S¦³ ªÅ®æªº¦r¦ê
sp = Split(t, " ")                                 <-³o¸Ìªº°}¦C¤W­­¤¸¯Àªº¯Á¤Þ­È ¥u¦³ 0
p1 = Split(sp(0), ",")
p2 = Split(sp(1), ",")                         <-  ³o¥²µM·|¥X²{ °}¦C¯Á¤Þ¶W¥X½d³ò ¿ù»~ 9
  1. Sub Ex()
  2. Dim A, AR, xi As Integer
  3. A = "A111,222,333,444" '³o¸ÌªºA¦r¦ê ®M¨ì oobird ¶Wª©ªºµ{¦¡ ·|¥X¿ù
  4. 'A = "A111,222,333,444 Baa,bbb,ccc,ddd C11,222,333,444 Daa,bbb,ccc,ddd"
  5. '¤W­±ªº A¦r¦ê ®M¨ì oobird ¶Wª©ªºµ{¦¡ OKªº
  6. AR = Split(A, " ")
  7. For xi = 0 To UBound(AR) 'UBound ¶Ç¦^ °}¦Cªº¤W­­¤¸¯Àªº¯Á¤Þ­È
  8. A = Split(AR(xi), ",")
  9. [a1].Offset(xi).Resize(, UBound(A) + 1) = A
  10. [G1].Offset(, xi).Resize(UBound(A) + 1) = Application.Transpose(A)
  11. 'Transpose ¤u§@ªí¨ç¼Æ :Âà¸m
  12. Next
  13. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# GBKEE

·PÁ GBKEE ¤jªº¦^ÂФ뜨ô¡K

¬ÛÃöªºµ{¦¡´ú¸Õ¡A¤]¥¿¦p GBKEE¤j ©Ò»¡ªº¤@¼Ë¡K

¦Ü©óÀ³¥Î¤è­±¡K¤p§ÌÁÙ­n¦A¬ã¨s¡B¾Ç²ß¡K
¨««æªº¤H¬Ý¤£¨£¦a¤Wªº°v¤l¡A ·Ð´oªº¤H¨É¨ü¤£¨ì©¯ºÖªº¤é¤l¡C

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD