VBA - Date Range - Fill in the gap dates/paste horizontally in different sheet

RyanMcL20

New Member
Joined
Oct 20, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello!

I'm new to VBA and am trying to come up with a code for the following purpose. I'll do my best to explain myself.
In this picture below in row 4 "Project Duration (x/xx/xxxx) To (x/xx/xxxx), the TWO highlighted cells (B4 & C4) make up the date range I need. This excel file is meant to be a template for others to fill in. With that being said there will obviously be different date ranges input into this every time. I have a form control button to the right of the highlighted cells with the intentions of making that button produce the desired outcome I want.

1.png


When the button is pressed, I want the two highlighted cells that make up the date range to fill in the gaps between months and paste the entire sequence to a different sheet, horizontally. But I don't want it to list everyday. I need it to list.. Example: Oct-2021, Nov-2021, Dec-2021, Jan-2022..etc
Each one of these months starting with Oct-2021 through to Aug-2022 needs to be pasted horizontally in it's own individual cell on another sheet. The sheet I need it pasted in is named "PGB" the sheet# is Sheet7 and the cell is D3.

Any guidance or help would be greatly appreciated. I'm stumped.

Thank you.
-Ryan
 

Attachments

  • 1.png
    1.png
    6.4 KB · Views: 11

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Have tried a few different ideas but can't come up with something solid as of yet.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,588
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top