- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-10-25 08:09 ½s¿è
«e½ú¦¦w!
¤µ¤Ñ¦¤W±N¬Q¤Ñ²q´ú±¡¹Ò½m²ß°}¦Cªºµ{¦¡½X¤ß±oµù¸Ñ¤@¤U!
½Ð¦U¦ì«e½ú«ü¥¿¨Ã«ü¾É! ÁÂÁÂ!
Option Explicit
Sub TEST()
Dim Brr, Arr, Crr, c&, i&, x&, xR, R&, T, V, Y, Z
Dim B#, j, K%, P$, Q, Ra
'¡ô«Å§iÅܼÆ
Y = Array("©u²Öp·l¯qªí", "¸ê²£t¶Å²ªí", "²Öp²{ª÷¬y¶q©uªí", "²{ª÷¬y¶q¦~ªí", "·l¯q¦~ªí")
'¡ô¥OY ¬O¤@ºû°}¦C ˤJ 5Óªíªº¦WºÙ¦r¦ê
For j = 0 To UBound(Y)
'¡ô³]¶¶¥~°j°é
Brr = Sheets(Y(j)).Range(Sheets(Y(j)).[B3], Sheets(Y(j)).Cells(Rows.Count, 2).End(3))
'¡ô¥OBrr°}¦C¸Ë¤JY ¦UÓªíªºÃöÁä¦r¦ê!
ReDim Arr(1 To UBound(Brr), 1 To 99)
'¡ô«Å§iArrªÅ°}¦Cªº¦C¼Æ¦PBrr!Äæ¼Æ99Äæ
For i = 1 To UBound(Brr)
'¡ô³]¶¶¤¤°j°é
If Trim(Brr(i, 1)) = "" Then
'¡ô¦pªGÃöÁä¦r¦ê¥hÀY§ÀªºªÅ¥Õ¦r¤¸«á¬OªÅ¦r¤¸?
GoTo 111
'¡ô±ø¥ó¦¨¥ß!´N¸õ¨ì 111 ªº¦ì¸mÄ~Äò°õ¦æ
End If
Crr = Split(Trim(Brr(i, 1)), " ")
'¡ô±NÃöÁä¦r¦ê¥hÀY§ÀªºªÅ¥Õ¦r¤¸«á,¥HªÅ¥Õ¦r¤¸¤À³Î¦r¦ê¦¨¬°Crr¤@ºû°}¦C
For x = 0 To UBound(Crr)
'¡ô³]¶¶¤º°j°é!±q0¨ìCrr°}¦Cªº«á¤@Ó
Arr(i, x + 1) = Crr(x)
'¡ô±NCrr¤@ºû°}¦C±a¤JArrªº¤Gºû°}¦C!
Next
111
Next
Sheets(Y(j)).[C3].Resize(UBound(Arr), 99) = Arr
'¡ô±N¦UÓªí±q[C3]¶}©l¶K¤Jµ²ªG¸ê®Æ
Next
Set Arr = Nothing
Set Brr = Nothing
Set Crr = Nothing
End Sub |
|