I'm looking to create a UserForm1 in Excel that when a user adds in a start date and end date - it will then create new rows in a table1 that populate as follows using VBA:
Example: User enters - START DATE: 5/9/2020 & END DATE: 5/16/2020
Table Returns (Rows and calculations added to table1):
DATE COUNT P1/P2 START DATE END DATE
5/9/2020 1 1 5/9/2020 5/16/2020
5/10/2020 2 2 5/9/2020 5/16/2020
5/11/2020 3 2 5/9/2020 5/16/2020
5/12/2020 4 2 5/9/2020 5/16/2020
5/13/2020 5 2 5/9/2020 5/16/2020
5/14/2020 6 2 5/9/2020 5/16/2020
5/15/2020 7 2 5/9/2020 5/16/2020
Date Column Shows: start date and a row for every day between 5/9 and 5/16 but not including 5/16
Count Column: Counts the rows added off one input
P1/P2 Column: Shows 1 for the first row added (record only) off the command and 2 for all the rest
Start Date: Shows the date entered as [start date]
End Date: Shows the date entered for [end date]
If someone enters a date that has 365 days in it, the table would end up with 365 added rows. Hoping to find a simple way I could do this like I would with SQL - but I haven't been able to find any examples in VBA.
I've been able to input data from a button on the userform which adds to the table at the end - I'm really needing direction on how to create multiple rows and manipulating the data to do what I want it to in VBA.
Appreciate any help you can offer.