Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I want a user to select a year 2001 to 2010, and then based on this selection choose a (Friday) weekend date. Other calculations are dependant upon the results from this last selection. I can do this without programming using data validation and the indirect function. However I wanted to try to do it using combo boxes. In the past I have only used the combo box from the forms toolbar and the input range does not recognise the INDIRECT function, or at least does not behave in the same way as data validation. When using the combo box from the control toolbox toolbar the indirect function does not appear to work when =INDIRECT is entered in the ListFillRange box in properties. I searched the discussion groups for a solution and I was directed to www.xldynamic.com/source/xld.Dropdowns.html from multiple postings. I copied / imported all of the code and modified it to meet my requirements re worksheet names (I replaced €śdata€ť with €śWeekEndingDates€ť) in the module mComboMaintain and elsewhere as required. When I open the workbook, after a while an error message appears Compile error, variable not defined. When debugging €ścombo€ť is highlighted in blue in the line €śWith combo.cboPrimary€ť The complete code is given below. Can anyone indicate where I need to look? Regards Phil Smith Option Explicit '--------------------------------------------------------------------- Public Function fzPopulatList1() '--------------------------------------------------------------------- Dim i As Long Application.EnableEvents = False 'On Error GoTo pl1_exit With combo.cboPrimary .Clear For i = 2 To Range(kList1Hnd).Count + 1 .AddItem WeekEndingDates.Cells(1, i).Value Next i Application.EnableEvents = True .ListIndex = 0 End With pl1_exit: Application.EnableEvents = True End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Importing downloads into Excel | New Users to Excel | |||
How do I resolve unsuccessful security downloads for excel? | Excel Discussion (Misc queries) | |||
Comma delimiter for csv downloads? | Excel Discussion (Misc queries) | |||
File Downloads in VBA | Excel Discussion (Misc queries) | |||
How do I find downloads for workbooks for Accounting homework? | Excel Worksheet Functions |