Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the following code, I would like to be able to dim a listbox variable,
lboBox, and then insert the following after the first loop line: For Each CTL In frmSettings.Controls If TypeOf CTL Is MSForms.ListBox Then set lboBox = CTL Elseif Typeof CTL is MSForms.Combobox then set cboBox = CTL end if I can't figure out seems always (from the very beginning) Dimmed as a combobox control, and therefore skips the first IF Then line EVEN when the control is a ListBox. Any thoughts would be greatly appreciated. My problem code: Private Sub InitializeIndicators(frmSettings As MSForms.UserForm) On Error GoTo InitializeIndicators_Err Dim cboBox As MSForms.ComboBox Dim strboxName As String Dim i As Integer Dim CTL As MSForms.Control For Each CTL In frmSettings.Controls If TypeOf CTL Is MSForms.ComboBox Then If InStr(1, LCase(CTL.Name), LCase("lboIndicator")) Then Set cboBox = CTL Call FillListBox(cboBox, ListRows("lboIndicator"), 0) ElseIf InStr(1, LCase(CTL.Name), LCase("lboPeriod")) Then Set cboBox = CTL Call FillListBox(cboBox, ListRows("lboPeriod"), 0) ElseIf InStr(1, LCase(CTL.Name), LCase("lboOperator")) Then Set cboBox = CTL Call FillListBox(cboBox, ListRows("lboOperatorLeft"), 0) ElseIf InStr(1, LCase(CTL.Name), LCase("lboOperator")) Then Set cboBox = CTL Call FillListBox(cboBox, ListRows("lboOperatorRight"), 1) End If End If Next Set cboBox = Nothing Exit Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
form control combobox | Excel Discussion (Misc queries) | |||
Control ToolBox ComboBox | Excel Discussion (Misc queries) | |||
Using Multiple sets of Option Buttons (Form Control) In Excell | Excel Worksheet Functions | |||
Excel Combobox Box Control | Excel Programming | |||
MsForms.Control Event Class | Excel Programming |