How to Copy a Cell to Clipboard using Macros (VBA) in Excel 365?
Tags: copyacelltoaclipboar, vbamacros
Published: 2021-02-20 06:09:08

---
title: How to Copy a Cell to Clipboard using Macros (VBA) in Excel 365?
published: true
date: 2021-02-20 06:08:24 UTC
tags: Copyacelltoaclipboar,VBAMacros
canonical_url: https://geekexcel.com/how-to-copy-a-cell-to-clipboard-using-macros-vba-in-excel-365/
---

In this post, we will show you the ways to **copy a cell to a clipboard using Macros (VBA)** in **Excel Office 365**. With the help of Macros and [VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/), we can finish the task with a single click. You just follow the steps given below to achieve the task.
## Copy a Cell to Clipboard using Macros:

- First, you have to open the worksheet that contains cells that you want to copy to the clipboard.
- Here, we have shown the example cells in the range **B1:B5** in **sheet1**.

![Input range](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_OFdnXyS2XP.png)<figcaption id="caption-attachment-22043">Input range</figcaption>

- You have to **right-click** on the **sheet**  **tab** , then **select** the **View Code** option from the menu.

![Click the View Code option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_zJnIkDtwzw.png)<figcaption id="caption-attachment-22044">Click the View Code option</figcaption>

- Then you need to copy and paste the code given below.

VBA code to Copy a Cell using Macros

Private Sub Worksheet\_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range(“B1:B5”)) Is Nothing Then

Target.Copy

End If

End Sub

- You need to **save the code** by selecting it. Then **close** the **window.**

![Save the code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_DfNU3VYNpi.png)<figcaption id="caption-attachment-22046">Save the code</figcaption>

- You need to click a cell to copy its value to the clipboard and select the destination cell and press Enter key to paste the value.

![Output](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/pg5pacx9yx.png)<figcaption id="caption-attachment-22047">Output</figcaption>

- Now, you can click a cell from **B1:B5** , you will see that all cell that you clicked is copied to the clipboard automatically.

## Conclusion:

In this post, you can clearly learn the simple steps to **copy a cell to a clipboard using Macros (VBA)** in **Excel Office 365**. Drop your **worthwhile**  **feedback** with us. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!

#### Keep Reading:

- [How to Highlight All Errors Using Macros (VBA) In Excel Office 365?](https://geekexcel.com/how-to-highlight-all-errors-using-macros-vba-in-excel-office-365/)
- [Remove Extra Spaces from Selection Using Macros (VBA) in Excel!!](https://geekexcel.com/remove-extra-spaces-from-selection-using-macros-vba-in-excel/)
- [Create the Data Entry Form using Macros (VBA) in Excel Office 365!](https://geekexcel.com/create-the-data-entry-form-using-macros-vba-in-excel-office-365/)
- [Insert a Linked Image using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/insert-a-linked-image-using-macros-vba-in-excel-office-365/)