Set Rng = Union(Range("D5:N18"), Range("D35:N48"), Range("D65:N83"))
For i = 1 To Rng.Areas.Count
For j = 1 To Rng.Areas(i).Rows.Count
ReDim Preserve Ar(s)
Ar(s) = Rng.Areas(i).Rows(j)
s = s + 1
Next
Next
Ay = Application.Transpose(Application.Transpose(Ar))
Sheet2.[A1].Resize(UBound(Ay, 1), UBound(Ay, 2)) = Ay
End Sub
複製代碼
作者: oobird 時間: 2010-10-30 20:20
對於取固定區域或許可以想單純些:
Sub nn()
Dim Rng As Range
Set Rng = Union(Range("D5:N18"), Range("D35:N48"), Range("D65:N83"))
Rng.Copy Sheet2.[a1]
End Sub作者: GBKEE 時間: 2010-10-31 09:55