0
我試圖在不使用剪貼板的情況下將值粘貼到不同工作表上的動態範圍。當代碼到達Range = Range部分時,它會錯誤地指出「應用程序定義或對象定義的錯誤」。有任何想法嗎?複製到沒有剪貼板的動態範圍
Sub Test2()
Dim Start As Worksheet
Dim ED As Worksheet
Dim r As Integer, c As Integer, r1 As Integer, c1 As Integer
Set Start = Sheets("Start")
Set ED = Sheets("End")
r = 1
c = ActiveSheet.UsedRange.Columns.Count
With Start
Do Until .Cells(r, c).Value = ""
r = r + 1
Loop
r = r - 1
End With
r1 = 1
c1 = ActiveSheet.UsedRange.Columns.Count
With ED
Do Until .Cells(r1, c1).Value = ""
r1 = r1 + 1
Loop
r1 = r1
Range(Cells(r1, 1), Cells(r1 + r - 1, c1)) = Start.Range(Cells(r, c), Cells(1, 1))
Start.Activate
'.Range(.Cells(R1,1),.Cells(R1 + R1,C1))值= Start.Range(Start.Cells(R ,c),Start.Cells(1,1))。Value' Qualify *** EVERY *** Range object with its parent sheet。 –