How to automatically copy a cell to clipboard with single click in Excel?
Normally, when copying a cell to clipboard, you need to select the cell firstly, and then press the Ctrl + C key to copy it. How to automatically copy a cell by just clicking on it without pressing the hotkeys? Method in this article can help you.
Automatically copy a cell to clipboard by clicking with VBA code
Automatically copy a cell to clipboard by clicking with VBA code
The following VBA code can help you copy a cell to the clipboard by just clicking it in Excel. Please do as follows.
1. Open the worksheet you want to make cells copied to clipboard automatically, right click the sheet tab and then select View Code from the right-clicking menu. See screenshot:
2. In the opening Microsoft Visual Basic for Applications window, please copy the VBA code into the Code window.
VBA code: Automatically copy a cell to clipboard by clicking
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A9")) Is Nothing Then
Target.Copy
End If
End Sub
Note: In the code, A1:A9 is the cells you will copy to clipboard automatically. Please change it based on your need.
3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.
When clicking on any cell of range A1:A9, the cell will be copied automatically to the clipboard as below screenshot shown.
And then, you can select a destination cell and press Enter key to paste the copied contents.
Related articles:
- How to copy cells data with row height and column width in Excel?
- How to auto copy and paste cell in current sheet or from one sheet to another in Excel?
- How to disable cut, copy and paste functions in Excel?
- How to copy only borders of selected range in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!





