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.
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.
- 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?
You are guest
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 1 years agoi just want to do reverse of it like i copied text data from other software now as i click on excel i want that data to be paste automatically without me being pressing Control plus V. please provide VBA code for it please i need that a lot.
- To post as a guest, your comment is unpublished.· 2 years agoits working great. thanks
- To post as a guest, your comment is unpublished.· 3 years agoMuito obrigado!
Trabalhei por alguns anos no ctrl C crtl V de uma mesma planilha de dados para o sistema que eu uso no trabalho... essa simples ação de já selecionar copiando me tirou um "fardo" enorme das atividades diárias!