View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Removing item from combobox with vba

You can, but removeitem requires an index

comTeam2.RemoveItem comTeam1.ListIndex

--
Regards,
Tom Ogilvy


"SOS" wrote in message
...

Tom,

The comboboxes are populated during the UserForm_Initialize() event:

Private Sub UserForm_Initialize()
With comTeam1
AddItem "Airdrie"
AddItem "West Lothian"
End With - (many more teams in the real sheet)

With comTeam2
AddItem "Airdrie"
AddItem "West Lothian"
End With - (many more teams in the real sheet)
End Sub

So I felt that during the code I could use something like:

"comTeam2.RemoveItem comTeam1"

Thanks

Seamus


--
SOS
------------------------------------------------------------------------
SOS's Profile:

http://www.excelforum.com/member.php...fo&userid=5406
View this thread: http://www.excelforum.com/showthread...hreadid=263147