- ©«¤l
- 163
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 170
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- Office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-9-5
- ³Ì«áµn¿ý
- 2022-7-20
|
¦^´_ 8# tommy.lin
ÀɮפU¸ü¡Ghttp://ge.tt/5PcoXKg1/v/0?c
©î¸Ñ¨Ó·½¬°A¡ãDÄæ¡A
©î¸Ñ«á¼g¤JE¡ãIÄæ¡C
Option Base 1
Sub test1()
Dim arr1, arr2
Dim brr()
er = [A65536].End(3).Row
arr1 = Range("A2:D" & er)
ActiveSheet.Columns(4).Replace "/", ";"
arr2 = Range("A2:D" & er)
For i = 1 To UBound(arr2)
For j = 0 To UBound(Split(arr2(i, 4), ";"))
n = n + 1
ReDim Preserve brr(5, n)
If j = 0 Then
brr(1, n) = arr2(i, 1)
brr(2, n) = arr2(i, 2)
brr(3, n) = arr2(i, 3)
brr(4, n) = arr2(i, 1)
End If
brr(5, n) = Split(arr2(i, 4), ";")(j)
Next j
Next i
[E2:I65536].ClearContents
[E2].Resize(UBound(brr, 2), 5) = Application.Transpose(brr)
Range("A2:D" & er) = arr1
arr1 = ""
arr2 = ""
Erase brr
End Sub |
|