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

daithiboy

Board Regular
Joined
Jul 1, 2016
Messages
72
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
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Watch MrExcel Video

Forum statistics

Threads
1,123,423
Messages
5,601,574
Members
414,460
Latest member
uctc

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
Top