vba courses london - how clear excel clipboard
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - How to Clear Excel ClipBoard

vba courses london - How to Clear Excel ClipBoard

resolvedResolved · Low Priority · Version Standard

replyReply Thu 30 Nov 2006, 16:16Delegate Sejal said...

Sejal has attended:
Excel VBA Intro Intermediate course

How to Clear Excel ClipBoard

How do you write VBA code to clear clipboard? E.g. when you are copying and pasting lots of data this can cause you to use up excess memory and sometimes crash Excel as a result. Hence, how can you avoid this?

For upcoming training course dates see: Pricing & availability

replyReply Fri 1 Dec 2006, 10:58 Edited on Fri 1 Dec 2006, 10:59Trainer Carlos said...

RE: How to Clear Excel ClipBoard

The quickest way to clear information from the Excel clipboard is the code line

Application.CutCopyMode = False

If used after every paste it keeps the Clipboard empty.

However you can Bypass the Clipboard by NOT using Copy and Paste. To do this:

Instead of

Sheets("London").Select
Range("H9:H16").Copy
Sheets("Yearly Total").Select
Range("D9").Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

Use

Sheets("Yearly Total").Range("D9:D16") = Sheets("London").Range("H9:H16").Value

 

Vba tip:

Empty The Clipboard with CutCopyMode

After each Copy/Paste operation in VBA, you should use the following line of code to empty the clipboard. This ensures that the computer memory doesn't overload:

ActiveSheet.Paste
Application.CutCopyMode = False

View all VBA hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard