logo
search
VBA & Macro Problems

How to Stop Excel Copy Mode Using Application.CutCopyMode

Partner EditorPartner Editor Sep 28, 2026 869 views

Question details

The user wants to stop Excel from remaining in copy mode and clear the clipboard using VBA, but the standard commands do not appear to be working.

How to Stop Excel Copy Mode Using Application.CutCopyMode in VBA
Product
Excel
Device & OS
not provided
Scenario
Writing a VBA macro to automate copying and pasting data, and needing to clear the selection or clipboard afterwards.
Observed behavior
The Application.CutCopyMode command clears Excel's internal copy mode but fails to delete items from the Windows clipboard history, leading to confusion about its effectiveness.
Before you start

Before modifying your VBA script, ensure you understand the difference between Excel's internal copy mode (the moving border) and the system-wide Windows clipboard.

Solution 1Recommended

Clear Excel's Copy Mode with CutCopyMode

Use this VBA property after a paste operation to remove the 'marching ants' selection border and clear Excel's internal copy state.

The Application.CutCopyMode property determines whether Excel is in Cut or Copy mode. Setting it to False clears the moving border around copied cells. It is important to note that this only affects Excel's internal state; it does not erase the contents of the Windows clipboard history.

Placing this command before your copy operation will have no effect. It must be executed after you have completed copying and pasting the data.

1
Open the VBA Editor

Press Alt + F11 in Excel to open the Visual Basic for Applications editor.

2
Locate Your Macro

Find the specific module and subroutine where your copy or paste commands are executed.

3
Insert the Command

Type 'Application.CutCopyMode = False' on a new line immediately following your final paste command.

Clear Excel's Copy Mode with CutCopyMode
Windows Clipboard Limitation: If your goal is to completely clear the Windows clipboard to prevent pasting in other applications, you will need to use specific Windows API calls instead of this standard Excel command.

Use WPS Spreadsheets to Edit and Run VBA Macros

WPS Office provides excellent support for VBA macros, allowing you to seamlessly run Excel scripts and automate your workflow with high compatibility.

  1. 1. Open Your Spreadsheet: Launch WPS Office and open the workbook containing your macro.
  2. 2. Access the Developer Tools: Navigate to the Developer tab. If it is hidden, enable it in the customized ribbon settings.
  3. 3. Open the VBA Editor: Click on 'Visual Basic' or press Alt + F11 to launch the integrated VBA editor.
  4. 4. Apply CutCopyMode: Add Application.CutCopyMode = False at the end of your macro and run it to clear the selection.
Fully compatible with Microsoft Excel files (.xlsx, .xlsm, .xlsb).Built-in VBA editor for creating, editing, and debugging macros.Free and lightweight alternative for your spreadsheet automation needs.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Application.CutCopyMode clear my Windows clipboard?

This property only manages Excel's internal selection state. It removes the 'marching ants' border around copied cells but does not have the capability to clear the operating system's clipboard history.

Can I place the CutCopyMode command before copying?

No, placing it before a copy command will not prevent data from being copied or sent to the clipboard. It must be placed after the copy and paste operations are completed.

Does this issue happen because of 64-bit Office?

No, the behavior of Application.CutCopyMode is identical in both 32-bit and 64-bit versions of Office. It simply is not designed to clear the system clipboard.

How can I completely clear the Windows clipboard in VBA?

Clearing the Windows clipboard completely requires more advanced coding using Windows API functions or manipulating DataObjects, which goes beyond standard Excel application properties.