How to cut and past range from one worksheet to another?

Phil Smith

Active Member
Joined
Aug 13, 2004
Messages
285
Office Version
  1. 365
Platform
  1. Mobile
My code keeps failing at this line and I am banging my head against a brick wall! :banghead:

Code:
[URL="https://www.mrexcel.com/forum/newthread.php?do=newthread&f=10"]
Sheets("Diagrams").Range(Cells(LastCR, 1), Cells(LastEnd, 6)).Cut Destination:=Sheets("New Diagram")[/URL]

For the first range to be cut, LastCR=6862 and LastEnd=6807. How do I cut this range to the worksheet "New Diagram"?

Thank you....
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Maybe, changing Range("A2") to suit.
Code:
Sheets("Diagrams").Range(Sheets("Diagrams").Cells(LastCR, 1), Sheets("Diagrams").Cells(LastEnd, 6)).Cut Destination:=Sheets("New Diagram").Range("A2")

P.S. please don't use URL tags when posting code.
 
Upvote 0
You Sir, are a genius.:biggrin:

Can you explain why Sheets("Diagrams") has to be referenced for the start of the range and the end of the range when it has already been reference before .Range?
 
Upvote 0
Because any form of range (and Cells is a range) unless referenced by the sheet refers to the activesheet so unless Sheets("Diagrams") is the activesheet you are referencing 2 different sheets in a range which will produce an error.
 
Upvote 0

Forum statistics

Threads
1,223,604
Messages
6,173,312
Members
452,510
Latest member
RCan29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top