+ Reply to Thread
Results 1 to 2 of 2

Deleting items from a combobox

  1. #1
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Deleting items from a combobox

    Hi all,

    I'm currently trying to produce a userform for a friend that has two comboboxes (among other controls) The two comboboxes show teams which play each other in football games.

    I can populate the comboboxes on UserForm_Initialize but my problem is that when a team is chosen from Combo No 1 I want that entry to be removed from Combo No 2 (as a team cannot play against itself).. Can anyone point me in the right direction for the code to achieve this?

    Many thanks in advance

    Seamus

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    I managed to work it out.

    My comboboxes are named comTeam1 and comTeam2 and I have used the following code:

    Private Sub comTeam1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    comTeam2.RemoveItem comTeam1.ListIndex
    End Sub

    and that works just fine.

    Regards

    Seamus

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1