Hello,
Does anyone have a formula/function to take the current date and populate a combobox with this date and the 30 days after that ?
Thanks for any help...
Printable View
Hello,
Does anyone have a formula/function to take the current date and populate a combobox with this date and the 30 days after that ?
Thanks for any help...
Try something like this:VB Code:
Private Sub PopulateCombo(combo As ComboBox) Dim i As Long For i = 0 To 30 combo.AddItem DateAdd("d", i, Date) Next i combo.ListIndex = 0 End Sub
Thanks.... ! :D
alternatively you could avoid calls to DateAdd and do (in the loop):VB Code:
combo.AddItem Date + i
Good call. Simple is better (usually) :) . Oh yeah, and about 60% faster too.Quote:
Originally Posted by bushmobile