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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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