Consulting

Results 1 to 2 of 2

Thread: Fill a combobox from a spreadsheet?

  1. #1

    Fill a combobox from a spreadsheet?

    Hi. It's been years since I did any VBA and need to relearn some basics.

    I need to fill a combobox from a list on a spreadsheet. That isn't hard - either use .additem, or set the RowSource of the combobox to the column. The issue is that more entries may be added to the list at any time, and the combobox needs to auto-update itself when the userform is started.

    RowSource could be set to something ridiculous like a1:1000, but this leaves a massive chunk of the combobox list as blank.

    I used to have a simple way of doing it but I can't remember - I usually set a blank cell out of the way somewhere to counta(a:a) - this counts the number of entries in the list, then I set up an array that gets all the data up to the number in that counta cell.

    Any ideas?

  2. #2
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    Welcome to VBA Express!

    Like this.

    David


Posting Permissions

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