Having a bit of trouble with the following code. I am attempting t
create a drop down box that contains the contents of a list of cells.
The cells aren't in a fixed location and there could be a differen
number of items depending on another list box. So the array can't be
fixed size. How can I add the items I want to the array and the
display them in the combobox?
Thanks
Code
-------------------
Private Sub Categorybox_Change()
Dim typ() As Integer
Dim x As Integer
Dim r As Integer
Dim c As Integer
c = 2
r = 2
x = 0
Do While Cells(r, c) < categorybox.Value
r = r + 1
Loop
Do While Cells(r, c) = categorybox.Value
ReDim typ(x + 1)
typ(x) = Cells(r, (c + 1))
x = x + 1
r = r + 1
Loop
Typebox.List = typ()
End Sub
-------------------
--
musictec
-----------------------------------------------------------------------
musictech's Profile:
http://www.excelforum.com/member.php...fo&userid=2485
View this thread:
http://www.excelforum.com/showthread.php?threadid=38995