我在網上搜索了一下,但還沒有找到任何完全一樣的問題。我正在嘗試複製多個單獨的區域,並將它們粘貼到另一個表單上的一行中。這是我迄今爲止所做的。複製多個範圍並粘貼爲一個統一範圍(在列中)
Sub CopyTitle()
Dim range1 As Range
Dim range2 As Range
Dim range3 As Range
Dim range4 As Range
Dim range5 As Range
Dim range6 As Range
Dim range7 As Range
Dim range8 As Range
Dim range9 As Range
Dim range10 As Range
Dim range11 As Range
Dim multipleRange As Range
Set range1 = Sheets("RAW").Range("B8")
Set range2 = Sheets("RAW").Range("D9")
Set range3 = Sheets("RAW").Range("F10")
Set range4 = Sheets("RAW").Range("F12")
Set range5 = Sheets("RAW").Range("F14")
Set range6 = Sheets("RAW").Range("D15")
Set range7 = Sheets("RAW").Range("F16")
Set range8 = Sheets("RAW").Range("F18:F21")
Set range9 = Sheets("RAW").Range("F23:F24")
Set range10 = Sheets("RAW").Range("F26:F33")
Set range11 = Sheets("RAW").Range("F35:F40")
Set multipleRange = Union(range1, range2, range3, range4, range5, range6, range7, range8, range9, range10, range11)
multipleRange.Copy
Sheets("RAW").Cells(10, 10).PasteSpecial Transpose:=True
End Sub
我在multipleranges.copy中收到一個錯誤。它說多個範圍不能被複制。我能做些什麼來實現我的目標?
我檢查這個! –
看起來不錯!謝謝 –