LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ranges in combobox

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 PM
Sort Macro: Utilizing ComboBox Selection for Key1 through 3 Ranges buddhapenguin Excel Discussion (Misc queries) 0 May 13th 05 03:01 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"