How To Change a Row or Rows to values using VBA in Microsoft Excel?
Tags: tochangearoworrowsto, vbamacros
Published: 2021-10-20 04:56:48

---
title: How To Change a Row or Rows to values using VBA in Microsoft Excel?
published: true
date: 2021-10-19 05:38:25 UTC
tags: ToChangeARowOrRowsTo,VBAMacros
canonical_url: https://geekexcel.com/how-to-change-a-row-or-rows-to-values-using-vba-in-microsoft-excel/
---

In this blog post, we are going to see how to  **change a row or rows to values using VBA ** in Microsoft Excel. Let’s get into this article!! Get an 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 rows value to row value

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

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Sample-data-28.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_6()
Rows("1").Value = Rows("2").Value
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-56.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-47.png)<figcaption>Run the Code</figcaption>

- Finally, after running the macro, you will get  **output ** as **1st Row value will get update in the 2nd row value** as given below.

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

## Change the multiple row values from other multiple row values

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

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Ex-Sample-data.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_7()
Rows("1:3").Value = Rows("5:7").Value
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.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/Ex-Run-the-Code.png)<figcaption>Run the Code</figcaption>

- Finally, after running the macro, you will get  **output as row values will get updated** as given below.

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

## Conclusion

In the above post, you can learn the simple steps ** ** on how to  **change a row or rows to values using VBA**  in Microsoft Excel. Kindly, share your  **feedback**  in the below comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!

**Continue Reading:**

- **[Excel ROW Function in Office 365 – How to use ?](https://geekexcel.com/row-function-in-microsoft-excel-365-how-to-use/)**
- **[Excel Office 365 Rows – [Insert, Delete, Hide, Unhide]](https://geekexcel.com/excel-office-365-rows-insert-delete-hide-unhide/)**
- **[How To Copy a column or columns from each sheet into one sheet using VBA in Excel?](https://geekexcel.com/how-to-copy-a-column-or-columns-from-each-sheet-into-one-sheet-using-vba-in-excel/)**