How To Change all the cells in the ActiveSheet to values using VBA in Excel?
Tags: tochangeallthecellsi, vbamacros
Published: 2021-10-20 10:06:59

---
title: How To Change all the cells in the ActiveSheet to values using VBA in Excel?
published: true
date: 2021-10-20 04:56:20 UTC
tags: ToChangeAllTheCellsI,VBAMacros
canonical_url: https://geekexcel.com/how-to-change-all-the-cells-in-the-activesheet-to-values-using-vba-in-excel/
---

In this tutorial, you will learn how to  **change all the cells in the ActiveSheet to values using VBA**  in Microsoft Excel. Let’s see them below!! Get the official version of  **MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

## Change all the cells value in the Active sheet

- Firstly, you need to  **create a sample data**  in Excel Spreadsheet.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Sample-data-34.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Sub Values_1()
With ActiveSheet.UsedRange
Range("A1:I7").Value = Range("A2").Value
End With
End Sub

```

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Save-the-Code-62.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- Then, you need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Run-the-Code-52.png)<figcaption>Run the Code</figcaption>

- Finally, after running the macro, **cell A2 value** will get update in the **define range ** as given below in Excel.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Output-34.png)<figcaption>Output</figcaption>

## Change the value from first table to second table

- Firstly, you need to  **create a sample data**  in Excel Spreadsheet.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Ex-Sample-data-3.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Sub Values_1()
With ActiveSheet.UsedRange
Range("A3:I5").Value = Range("A8:I10").Value
End With
End Sub

```

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Ex-Save-the-Code-2.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- Then, you need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Run-the-Code-52.png)<figcaption>Run the Code</figcaption>

- Finally, after running the macro, you will get  **output ** as given below in Excel.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Ex-Output-3.png)<figcaption>Output</figcaption>

## Bottom-Line

We hope that this tutorial gives you guidelines on how to  **change all the cells in the ActiveSheet to values using VBA**  in Microsoft Excel. ** ** Please leave a comment in case of any  **queries,**  and don’t forget to mention your valuable  **suggestions**  as well. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Read Also:**

- **[How To Change the formula in the cells in a range to values using VBA?](https://geekexcel.com/how-to-change-the-formula-in-the-cells-in-a-range-to-values-using-vba/)**
- **[Shortcuts for Active Cell Options in Microsoft Excel 365](https://geekexcel.com/shortcuts-for-active-cell-options-in-microsoft-excel-365/)**
- **[Convert a Table to the Data Range in Excel Office 365!!](https://geekexcel.com/convert-table-to-data-range/)**
- **[Shortcut to Select ACTIVE CELL Only in Microsoft Excel 365!!](https://geekexcel.com/shortcut-keys-to-select-active-cell-only-in-excel-365/)**
- **[Shortcuts to { Edit the Active Cell } in MS Excel 365!!!](https://geekexcel.com/simple-keyboard-shortcuts-to-edit-the-active-cell-in-ms-excel-365/)**