looping days in month-year looping days in month-year 2009luca (Programmer) (OP) 27 Nov 18 13:21 I just have a myvar="02-2018" (month-year) How to loop all days in this period? Tks. RE: looping days in month-year mintjulep (TechnicalUser) 27 Nov 18 13:32 Look up plus check for leap year would probably be simplest. https://www.mathsisfun.com/measure/months.html RE: looping days in month-year gmmastros (Programmer) 27 Nov 18 13:42 The simplest way is to convert to date, and loop on the date, like this. CODEDim myVar As String Dim StartDate As Date Dim EndDate As Date Dim ThisDate As Date myVar = "02-2018" StartDate = CDate(myVar) EndDate = DateAdd("d", -1, DateAdd("m", 1, StartDate)) For ThisDate = StartDate To EndDate Debug.Print ThisDate Next -George Microsoft SQL Server MVP My Blogs SQLCop twitter "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom RE: looping days in month-year 2009luca (Programmer) (OP) 27 Nov 18 14:08 hI George, tks from Italy... Exactlly what I needed! Nice code.