Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am trying to use a range to fill a series of comboboxes. I am using
a for loop to iterate through the comboboxes, and set the range as the list in the combobox. the problem is that i want to update to the range in response to a property specific to the combobox (.tag). here's my code Public Sub init_cboxes(ByVal LotLoc As String, ByVal MyForm As Object) Dim ctl As Control WT = Range("W_T") DT = Range("D_T") MyForm.Caption = LotLoc & ActiveCell.Value For Each ctl In MyForm.Controls If TypeName(ctl) = "ComboBox" Then RangeFill (ctl.Tag) ctl.List = WT ctl.ListIndex = 0 End If Next ctl MyForm.TextBox1.Value = 0 End Sub and here's my code for the sub Rangefill: Public Sub RangeFill(wtype As Integer) Dim i As Integer For i = 1 To 5 Range("w_t").Cells(2 + (2 * i)) = Price(wtype, i + 2) Next End Sub what i think is happening is that the variable WT is not being updated, even while the cells of the range are. I tried moving the assignment line WT = Range("W_T") after the line RangeFill(ctl.tag) but that didn't work. Any Advice. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
ComboBox list reliant on the entry from a different ComboBox | Excel Programming | |||
Sort Macro: Utilizing ComboBox Selection for Key1 through 3 Ranges | Excel Discussion (Misc queries) | |||
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox | Excel Programming | |||
named ranges - changing ranges with month selected | Excel Programming |