How to update data from one sheet to Another Sheet through VBA in Microsoft Excel?
Tags: toupdatedatafromones, vbamacros
Published: 2021-09-22 09:34:24

---
title: How to update data from one sheet to Another Sheet through VBA in Microsoft Excel?
published: true
date: 2021-09-17 11:26:33 UTC
tags: ToUpdateDataFromOneS,VBAMacros
canonical_url: https://geekexcel.com/how-to-update-data-from-one-sheet-to-another-sheet-through-vba-in-microsoft-excel/
---

In this tutorial, we will guide you on how to **update data from one sheet to another sheet** through VBA in Microsoft Excel. Let’s get them below!! 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)**

## Update Data On Sheet2 Base on Values Entered on Sheet1

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

![](https://geekexcel.com/wp-content/uploads/2021/09/Sample-data-19.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** insert Command button** from **Activexcontrol**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Insert-Command-Button.png)<figcaption>Insert Command Button</figcaption>

- Now, you have to select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- You need to  **copy and paste the code**  given below.

```
Private Sub CommandButton1_Click()
Dim User_Name As String, User_ID As Integer, Phone_Number As Double, Problem_ID As Integer
Worksheets("Sheet1").Select
User_Name = Range("B2")
User_ID = Range("B3")
Phone_Number = Range("B4")
Problem_ID = Range("B5")
Worksheets("Sheet2").Select
Worksheets("Sheet2").Range("A1").Select
If Worksheets("Sheet2").Range("A1").Offset(1, 0) <> "" Then
Worksheets("Sheet2").Range("A1").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = User_Name
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = User_ID
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Phone_Number
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Problem_ID
Worksheets("Sheet1").Select
Worksheets("Sheet1").Range("B2").Select
End Sub

```

- You have to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-46-1024x529.png)<figcaption>Save the Code</figcaption>

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

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you need to make sure that your  **macro name is selected**  and click the  **Run ** button.
- After that, you have to **enter the data** and will **click on update button**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Enter-the-data-2.png)<figcaption>Enter the data</figcaption>

- Finally, the **data** will get **update in another sheet** , and you can **enter a new data in the sheet**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Output-in-Another-Sheet.png)<figcaption>Output in Another Sheet</figcaption>

## Conclusion

We hope that this short tutorial gives you guidelines on how to **update data from one sheet to another sheet** through 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/) **!!**

**Continue Reading:**

- **[Excel Formulas to Find the Same Date in Next Year ~ Simple Guide!!](https://geekexcel.com/excel-formulas-to-find-the-same-date-in-next-year/)**
- **[Enter the Date in Excel Sheet ~ Step-by-Step Procedure!!](https://geekexcel.com/enter-the-date-excel/)**
- **[Find the Nth Largest Value in Excel Office 365 ~ Step-By-Step Procedure!!](https://geekexcel.com/find-the-nth-largest-value-in-excel/)**
- **[How to Extract Text Before Nth Specific Character in Excel?](https://geekexcel.com/extract-text-between-nth-specific-character-excel/)**
- **[Excel Formulas to Extract the Time from Date and Time ~ Quick Method!!](https://geekexcel.com/excel-formulas-to-extract-the-time-from-date-and-time/)**