Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba courses london - how clear excel clipboard

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

ResolvedVersion Standard

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?

Edited on Fri 1 Dec 2006, 10:59

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

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

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

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.