-
Hello,
Is there any possible way that you can use an array or something like it to fill a list box with all the possible dates of the year, with just the date and month and not the year????
(ie) having it automatically display 1st January til 31st December...without the year being shown...????
Hope someone can help...
Thanks,
Andy............
-
This code should get you started. You pass the year you want the dates for and it loops through putting the day and Month in a text box. you can modify the code to put the text in a listbox and format the day and month the way you want.
Code:
Private Function PopulateDates(strForYear As String)
Dim dtStartDate As Date
Dim dtCurrentDate As Date
dtStartDate = CDate("01/01/" & strForYear)
dtCurrentDate = dtStartDate
Do While strForYear = Format(dtCurrentDate, "yyyy")
Text1.Text = Text1.Text & Format(dtCurrentDate, "dd mmm") & vbCrLf
dtCurrentDate = dtCurrentDate + 1
Loop
End Function
Private Sub Command1_Click()
PopulateDates (2000)
End Sub