Add week commencing dates from choosing start of financial year date

dlee83

New Member
Joined
Mar 11, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm building a spreadsheet for financial data. Entering the data into the form with cells assigned to the dates is working fine. But I want to strip the sheet right back so that the user can determine which year/financial year the sheet starts with.

So, for example, the records for receipts need to start every Monday from 29/05/23, what i need the sheet to then display is the date of every Monday for the next 52 weeks. (across a row)

How can i get the user to just simply select a date on request, to then populate a sheet with all the relevant dates for the forthcoming year??

Any help is appreciated, any simple ideas I can convert to my code. Thanks in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about
Fluff.xlsm
ABCDEFGHIJK
129/05/202329/05/202305/06/202312/06/202319/06/202326/06/202303/07/202310/07/202317/07/202324/07/202331/07/2023
Main
Cell Formulas
RangeFormula
B1:BA1B1=WORKDAY.INTL(A1-1,SEQUENCE(,52),"0111111")
Dynamic array formulas.


I've only shown the first few dates, but you will get 52
 
Upvote 0
Sorry fluff, I'm looking for something in vba, so maybe a userform or combobox to select the year that then populates the row?
 
Upvote 0
For a combo on a userform you could use
VBA Code:
Private Sub UserForm_Initialize()
   Me.ComboBox1.List = [sequence(10,,2020)]
End Sub
 
Upvote 0
For a combo on a userform you could use
VBA Code:
Private Sub UserForm_Initialize()
   Me.ComboBox1.List = [sequence(10,,2020)]
End Sub
Fab, that's great.
So, now I've captured the year, how do i capture the first "Monday" of their financial year and display the commencing 52 weeks?
 
Upvote 0
How about
Excel Formula:
Private Sub CommandButton1_Click()
   Range("B2").Resize(, 52).Value = Evaluate("WORKDAY.INTL(date(" & Me.ComboBox1 & ",1,1) -1,SEQUENCE(,52),""0111111"")")
End Sub
 
Upvote 0
How about
Excel Formula:
Private Sub CommandButton1_Click()
   Range("B2").Resize(, 52).Value = Evaluate("WORKDAY.INTL(date(" & Me.ComboBox1 & ",1,1) -1,SEQUENCE(,52),""0111111"")")
End Sub
Since I formatted the cells, that puts all the Monday's dates in the row. Excellent! Thank you.
One more thing, if possible. How can we select the first date of, say, a financial year that may start on the first Monday in April and not necessarily the first Monday in January?

Thanks again
 
Upvote 0
You can change the 1st 1 after the " & Me.ComboBox1 & " to 4 for April
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

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