How To Distribute Data from a List of the day-to-day sheets using VBA?
Tags: todistributedatafrom, vbamacros
Published: 2021-10-05 02:48:42

---
title: How To Distribute Data from a List of the day-to-day sheets using VBA?
published: true
date: 2021-10-04 08:41:24 UTC
tags: ToDistributeDataFrom,VBAMacros
canonical_url: https://geekexcel.com/how-to-distribute-data-from-a-list-of-the-day-to-day-sheets-using-vba/
---

In this article, you will learn how to  **distribute data from a list of the day-to-day sheets ** 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)

## Example

- Firstly, you need to  **create a sample data**  with  **Date, Agent Name and Number of items sold**.

![](https://geekexcel.com/wp-content/uploads/2021/10/Sample-data-7.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://geekexcel.com/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 Divide()
'Declaring variables
Dim intRowS As Integer, intRowT As Integer
Dim strTab As String
'Initializing with starting row number
intRowS = 10
'Checking whether cell in first column is empty
Do Until IsEmpty(Worksheets(1).Cells(intRowS, 1))
   
   'Getting name of the sheet based on the date value in the first column
   strTab = Format(Cells(intRowS, 1).Value, "ddmmyy")
   
   'Getting the row number of last cell
   intRowT = Worksheets(strTab).Cells(Rows.Count, 1).End(xlUp).Row + 1
   
   'Copying data to respective sheet
   Rows(intRowS).Copy Worksheets(strTab).Rows(intRowT)
   intRowS = intRowS + 1
Loop
End Sub

```

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

![](https://geekexcel.com/wp-content/uploads/2021/10/Save-the-Code-5.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need 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 have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://geekexcel.com/wp-content/uploads/2021/10/Run-the-Code-6.png)<figcaption>Run the Code</figcaption>

- Finally, you will receive  **output as list and add days of the month in a set period**  using VBA as given below.

![](https://geekexcel.com/wp-content/uploads/2021/10/Output-5.png)<figcaption>Output</figcaption>

## Conclusion

We hope that this tutorial gives you guidelines on how to  **distribute data from a list of the day-to-day sheets**  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/) **!!**

**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/)**
- **[How To Delete Rows In Different Sheets Through Excel VBA?](https://geekexcel.com/how-to-delete-rows-in-different-sheets-through-excel-vba/)**
- **[Delete All Hidden Worksheets with One Click in Excel 365](https://geekexcel.com/how-to-delete-all-hidden-worksheets-with-one-click-in-excel-365/)**
- **[How to Show All Hidden Worksheets with One Click in Excel 365?](https://geekexcel.com/how-to-show-all-hidden-worksheets-with-one-click-in-excel-365/)**
- **[How to Copy Multiple Sheets Multiple Times in Excel Office 365?](https://geekexcel.com/how-to-copy-multiple-sheets-multiple-times-in-excel-office-365/)**