LIST DAYS IN A MONTH

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

LIST DAYS IN A MONTH

Post by sal21 »

peraphs just post... sorry for that.

based M=3 and A=2023, how to list all days?

note:
M is a numeric month A is the year

User avatar
SpeakEasy
4StarLounger
Posts: 562
Joined: 27 Jun 2021, 10:46

Re: LIST DAYS IN A MONTH

Post by SpeakEasy »

Code: Select all

Private Sub daylist(M As Long, A As Long)
    Dim D As Long
    Dim myday As Date
    For D = 1 To day(DateSerial(A, M + 1, 0))
        myday = DateSerial(A, M, D)
        Debug.Print Format(myday, "ddd d mmm yyyy")
    Next
End Sub

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: LIST DAYS IN A MONTH

Post by HansV »

Come on, Sal. You have asked this question (or a variation of it) several times now...
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: LIST DAYS IN A MONTH

Post by sal21 »

HansV wrote:
31 Oct 2023, 10:41
Come on, Sal. You have asked this question (or a variation of it) several times now...
Sorry...