+ Reply to Thread
Results 1 to 8 of 8

(De)Populating combobox

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    Newark, DE
    MS-Off Ver
    Excel 2002
    Posts
    30

    (De)Populating combobox

    Things moving along with my learning....was able to populate a combobox from data elsewhere in the workbook as follows:

    Please Login or Register  to view this content.
    Works great.

    Then I decided to try and combine a couple of Subs into this one. The purpose was to eliminate some entries from the combobox after checking another set of criteria. I thought I could use "RemoveItem" much like "AddItem" in the working code. The new sub looks like this.

    Please Login or Register  to view this content.
    What I'm trying to do is use every instance of vItem and retrieving the status from the adjacent column. It either works...or doesn't do anything provided I leave out the If/Then statement...because the combox populates as normal.

    Still new and learning...but can I use the RemoveItem argument here...or is it that I am just using it incorrectly?

  2. #2
    Registered User
    Join Date
    12-31-2008
    Location
    Chester, CA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: (De)Populating combobox

    I got great help from this site:
    Maybe you could use Data|Validation and use dependent lists.

    I'd start with Debra Dalgleish's site:
    http://contextures.com/xlDataVal02.html

  3. #3
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: (De)Populating combobox

    Hi

    I had a similar problem and found that the RemoveItem argument is used in conjuntion with the ListIndex and the Index number determines what will be removed.
    HTML Code: 
    perhaps this link will help.

    I have made a stab at amending your code as follows.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: (De)Populating combobox

    Try
    #[code]
    AircraftCrewForm.BomberNameComboBox.Clear[/code
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    01-23-2009
    Location
    Newark, DE
    MS-Off Ver
    Excel 2002
    Posts
    30

    Re: (De)Populating combobox

    Quote Originally Posted by jayers View Post
    I got great help from this site:
    Maybe you could use Data|Validation and use dependent lists.

    I'd start with Debra Dalgleish's site:
    http://contextures.com/xlDataVal02.html
    I was able to get things working another way...but thanks for the link...should be very useful in the future.

  6. #6
    Registered User
    Join Date
    01-23-2009
    Location
    Newark, DE
    MS-Off Ver
    Excel 2002
    Posts
    30

    Re: (De)Populating combobox

    Quote Originally Posted by solnajeff View Post
    Hi

    I had a similar problem and found that the RemoveItem argument is used in conjuntion with the ListIndex and the Index number determines what will be removed.
    HTML Code: 
    perhaps this link will help.

    I have made a stab at amending your code as follows.

    Please Login or Register  to view this content.
    I was unable to get this code to work right now...although it did help lead me in a new direction for possible future use.

    Thanks.

  7. #7
    Registered User
    Join Date
    01-23-2009
    Location
    Newark, DE
    MS-Off Ver
    Excel 2002
    Posts
    30

    Re: (De)Populating combobox

    Quote Originally Posted by royUK View Post
    Try
    #[code]
    AircraftCrewForm.BomberNameComboBox.Clear[/code
    I really thought this was the answer...but it appears that the 'Clear' argument applies to all Items currently in the list...not just that particular Item. Good to know for the future though.

    Thanks.

  8. #8
    Registered User
    Join Date
    01-23-2009
    Location
    Newark, DE
    MS-Off Ver
    Excel 2002
    Posts
    30

    Re: (De)Populating combobox

    Here is how I ended up fixing the problem. I was able to creat a Pivot Table that keeps a list of Items and their status that I do not want in the combobox.

    Please Login or Register  to view this content.
    Thanks again for all the replies.

+ 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