## LIST DAYS

sal21
PlatinumLounger
Posts: 4266
Joined: 26 Apr 2010, 17:36

### LIST DAYS

Based the month(date) and year(date), how to list the days of a block of 3 month...for example:

month(date) August
year(date) 2022

list the days of

August
September
October

01/08/2022
...
30/10/2022

===============

month(date) January
year(date) 2022

list the days of

January
February
March

01/01/2022
...
31/03/2022

HansV
Posts: 77253
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

### Re: LIST DAYS

Do you want to input the month by its name (August or Agosto), or by its number (8)?
Regards,
Hans

sal21
PlatinumLounger
Posts: 4266
Joined: 26 Apr 2010, 17:36

### Re: LIST DAYS

HansV wrote:
10 Aug 2022, 14:45
Do you want to input the month by its name (August or Agosto), or by its number (8)?
its number

HansV
Posts: 77253
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

### Re: LIST DAYS

Perhaps you can use this as a starting point.

Code: Select all

``````Sub ListDates()
Dim ANNO As Long
Dim MESE As Long
Dim DATO As Date
ANNO = 2022
MESE = 8
For DATO = DateSerial(ANNO, MESE, 1) To DateSerial(ANNO, MESE + 3, 0)
' Do something with DATO, for example
Debug.Print DATO
Next DATO
End Sub``````
Regards,
Hans

sal21
PlatinumLounger
Posts: 4266
Joined: 26 Apr 2010, 17:36

### Re: LIST DAYS

HansV wrote:
10 Aug 2022, 14:59
Perhaps you can use this as a starting point.

Code: Select all

``````Sub ListDates()
Dim ANNO As Long
Dim MESE As Long
Dim DATO As Date
ANNO = 2022
MESE = 8
For DATO = DateSerial(ANNO, MESE, 1) To DateSerial(ANNO, MESE + 3, 0)
' Do something with DATO, for example
Debug.Print DATO
Next DATO
End Sub``````