View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Problem number One

Robert,

You are not loading the combobox, so that is why you see nothing. But why
are you loading via a collection, it seems to serve no purpose that I can
ascertain.
Try this

Dim rng As Range
Dim v As Variant
Dim coll As Collection
Dim i As Long

Set coll = New Collection
Set rng = Range("AX1")
With timetable.Combobox1
For i = 1 To Cells(Rows.Count, "AX").End(xlUp).Row
If Cells(i, "AX").Value < "" Then
.AddItem Format(Cells(i, "AX"), "dd mmm yyyy")
End If
Next i
.ListIndex = 0
End With
timetable.Show



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert Couchman" wrote in message
...
Hello all,

i have a problem with my VB project...

i have a user form that should display a list of dates in
a column, dependent on the data held in column "AX" on a
spreadsheet. i have this bit of code already in my program
but...

Dim rng As Range
Dim v As Variant
Dim coll As Collection
Set coll = New Collection
Set rng = Range("AX1")
On Error Resume Next
Do Until rng.Value = ""
coll.Add rng.Text, rng.Text
Set rng = rng(2, 0)
Loop
With timetable.ComboBox1
For Each v In coll
.AddItem
Next v
.ListIndex = 0
End With
timetable.Show

...when ran, it just shows empty fields in the list!!!!

and....

also not all the records in column "AX" have dates in,
therefore it will end as soon as it hits a blanc cell.

can anyone help?? and i need it to find all the results
until it reaches my final row!

thank you,

Robert Couchman