Removing item from combobox with vba

  • Thread starter Thread starter SOS
  • Start date Start date
S

SOS

Hi all,

I am working on a soccer form and currently have 2 comboboxes (alon
with other controls) on a userform named comTeam1 and comTeam2 . The
are both populated with the same list of teams as the workbook opens.

Since a team cannot play against itself I would like to remove the tea
chosen in comTeam1 from comTeam2 when comTeam1 is changed.

I have tried:

Private Sub comTeam1_Change()
comTeam2.RemoveItem comTeam1.Value
End Sub

but this gives me an invalid call error. I would be grateful for som
help in this direction.

Many thanks

Seamu
 
How do you populate the comboboxes. If you bind the data to the control
(using the listfillrange or rowsource property), then you won't be able to
use removeitem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top