Terminate Copy Paste

ettool

New Member
Joined
Feb 7, 2005
Messages
35
Hi, I have a macro that I use to copy a range of cells from one sheet and paste to another. When I close the workbook I am told there is a large amount of data in the clipboard and do I want to save it. Also if I select the source worksheet the last range of cells are selected and the broken line is circling the cells. I am sure there is a code for terminating the copy function. Does anyone know what it is? Thamk you, ettool
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
use this..

Application.CutCopyMode = False

After you have pasted. This will save you all kinds of grief
 
Upvote 0
Hi,

You have applied copy method using two lines like
You could use another syntax and might avoid both problems (1. "large amount of data ..." & 2. "marching ants" around range) at once.
If you are interested, then please display the method you used.

kind regards,
Erik
 
Upvote 0
Hi Erik,
Here is my code:
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("A1").Resize(LR, 20).Select
Selection.Copy
Sheets("D VAL").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Thanks ettool
 
Upvote 0
Hi,

This one is faster and without clipboard usage:

Code:
Sub SimplerCopy()
  Dim LR
  LR = Range("A" & Rows.Count).End(xlUp).Row
  Sheets("D VAL").Range("A1").Resize(LR, 20).Value = Range("A1").Resize(LR, 20).Value
End Sub

Regards,
Vladimir
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

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