VBA to Save a copy on alternate weeks that are entered into a Userform

daithiboy

Board Regular
Joined
Jul 1, 2016
Messages
77
Folks,

I'm a few weeks now at trying to crack this issue and have made promising progress a few times until it inevitably falls down. I've been messing around with worksheet based solutions like Leila Gharani has (
) and another on ExcelJet (Excel formula: Get nth day of week in month | Exceljet) but can't put it all together to get what I want.

What I have is a userform that has text boxes for a start date, an end date and three boxes for recurring weeks. What I would like is for the user to be able to enter a start date (that corresponds with the recurring day of the week) and an end date. Then choose which weeks they want a file saved for i.e. 1st, 3rd & 5th Tuesday of the month. Then the excel gods take over and a copy is saved with a filename that matches with the dates. i.e. in January 2021, we would get a files dated the 05-01-21 & 19-01-21, the first and third Tuesdays.

I can't find a way to correctly identify the weeks that need to be saved.

Any help or suggestions would be greatly appreciated.

Many thanks in advance,
Dave
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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