Reputation: 245
I want cut some lines of my activesheet and paste it to the next sheet. But i will never know the name of the next sheet.
Tried it:
Range("1:26").Cut After:=ActiveSheet
Thank you.
Upvotes: 0
Views: 30
Reputation: 96753
Consider:
Sub cutandpaste()
Dim r1 As Range, r2 As Range
Set r1 = ActiveSheet.Range("1:26")
Set r2 = ActiveSheet.Next.Range("1:26")
r1.Cut r2
End Sub
or:
Sub another()
With ActiveSheet
.Range("1:26").Cut .Next.Range("1:26")
End With
End Sub
Upvotes: 1
Reputation: 42236
Range("1:26").Cut Worksheets(ActiveSheet.Index + 1).Range("A1")
or
Range("1:26").Cut Worksheets(ActiveSheet.Index + 1).Range("1:26")
if you want moving them in the same position...
Upvotes: 1