View Single Post
  #2   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

You cannot use RowSource and then AddItem. The AddItem can only be used
when the original method of populating the combobox was by AddItem or Array.
See VBA help file under AddItem for details.


"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.