View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Combobox - Problem on AddItem

One option would be to make your RowSource range dynamic so that it will
adjust if an item is added in that range. That would then require that
after an item is added that the range be re-initialized so that it picks up
the new item. Otherwise, you will have to change the method of loading the
combobox so that is uses the AddItem method when the form is initialized.


"Eddie_SP" wrote in message
...
Hi !

I have my Form with one Combobox.
I need it to show column 1 and 2. And it is ok.
The code is:


i = 5
While (ActiveSheet.Cells(1 + i, 11) < 0)
i = i + 1
If Cells(1 + i, 11).Text < "OK" And Cells(1 + i, 11).Text < ""
Then
Me.ComboBox1.RowSource = "Pedidos!A" & i & ":B" & i
Me.ComboBox1.AddItem 'HERE IS THE PROBLEM
With ComboBox1
.ColumnWidths = "50;80"
End With
End If
Wend


How could I add the item every time one line is in accordance with my
condiction?

Using the code above it just gives me the last row... =(

Someone help me?

Eddie.