Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I've got a problem with implementing Date function into combobox. I've got 3 comboboxes in my user form, one combo for day, second one for month and last one for year. I know that I can add item to combobox via .AddItem method but after this I want set the values (listindex) of these combo's to system date, instead of clicking by user, something like this: Dim IssueDate As Date Dim IssueDateYear As Long Dim IssueDateMonth As Long Dim IssueDateDay As Long Set IssueDate = Date Set IssueDateMonth = Month(IssueDate) With myform.IssueDateMonthCombobox .Clear .AddItem (IssueDateMonth-1) ' last month .AddItem (IssueDateMonth) .AddItem (IssueDateMonth+1) 'next month .ListIndex = ' set to IssueDateMonth End With When I'm trying to run this, Excel is saying "object required' and marking line "Set IssueDateMonth = " and "Private Sub UserForm_Initialize()" :-/ Has anyone dealt with this ? TIA Przemek |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use match function to add different item in Combobox | Excel Worksheet Functions | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Format Date ComboBox | Excel Discussion (Misc queries) | |||
2 questions! Related to combobox and time function. HELP!! | Excel Discussion (Misc queries) | |||
Calculating days between current date and a date in future NETWORKDAYS() function | Excel Worksheet Functions |