Hi,
I'm using XL 2002.
How do I populate ComboBox1 programtically, with a range of month and years
(using the format mmm-yy) starting with the current month of the current
year, incrementing monthly, year on year for 12 months?
So the combo would contain Apr-07 and end with Apr-08
Any ideas appreciated. Thank you.
Paul.
Greg Maxey - 20 Apr 2007 13:20 GMT
In the userform initialize event use something like:
Private Sub UserForm_Initialize()
Dim i As Long
Me.ComboBox1.AddItem Format(Date, "mmm yy")
For i = 1 To 11
Me.ComboBox1.AddItem Format(DateAdd("m", i, Date), "mmm yy")
Next i
End Sub
> Hi,
>
[quoted text clipped - 9 lines]
>
> Paul.
Paulc - 20 Apr 2007 13:54 GMT
XL'nt - thank you.
> In the userform initialize event use something like:
> Private Sub UserForm_Initialize()
[quoted text clipped - 18 lines]
> >
> > Paul.