Hi,
I am new to VBA coding. I just made a program where I created a Userform having three ComboBox viz., Day, Month and Year.
I have successfully managed to fill those with required data. In ComboBoxYear, the dropdown year starts with least (i.e., 1960, which I have kept), and ends with current year (i.e., 2017).
I want to change this dropdown list, starting from 2017, and goes on decreasing till 1960.
Below is the code part where I have coded for inputs for DDMMYYY.
What I have tried:
Private Sub UserForm_Initialize()
Dim i As Integer
With UserForm1
For i = 1 To 31
.ComboBoxDay.AddItem (i)
Next
End With
Dim ctr As Long
For ctr = 1 To 12
Me.ComboBoxMonth.AddItem Format(DateSerial(YYYY, ctr, DD), "mmm")
Next ctr
With UserForm1
For i = 1960 To 2017
.ComboBoxYear.AddItem (i)
Next
End With
End Sub