+ Reply to Thread
Results 1 to 9 of 9

Populating Combobox with simple Name

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Populating Combobox with simple Name

    Hi,

    I have created 2 Names in Excel Name Manager like this

    Please Login or Register  to view this content.
    What I want is to populate 2 combobox from the same Names.
    Your help would be greatly appreciated.

    Best Regards
    Imran Bhatti
    Last edited by ImranBhatti; 09-04-2019 at 08:04 AM.
    Teach me Excel VBA

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Populating Combobox with simple Name

    Currently using this workaround but is there a way to directly populate lilke ComboBox.List = Abr

    Please Login or Register  to view this content.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Populating Combobox with simple Name

    You could put an array into the name:

    Please Login or Register  to view this content.
    then assign it like this:

    Please Login or Register  to view this content.
    though I'm not sure I see how that's a real improvement.
    Rory

  4. #4
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Populating Combobox with simple Name

    That did the trick Rory.

    Much appreciated indeed

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Populating Combobox with simple Name

    Sorry for marking the thread "Unsolved" again.

    at first I actually assign the [Abr] to an array which was successful but while trying to directly assign it to combobox's .list it says

    "Could not the list property.invalid property index"

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Populating Combobox with simple Name

    That tends to mean that your variable is not actually an array.

  7. #7
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Populating Combobox with simple Name

    "Could not the list property.invalid property index"
    occures when I directly assign the name to combobox like this

    ComboBox.List = [Abr]

    But when I do this

    AnArray = [Abr]

    it does contain values of "Abr" if I add a watch on "AnArray"

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Populating Combobox with simple Name

    This seems to work for me (if I understand correctly).

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Populating Combobox with simple Name

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 03-22-2018, 11:25 AM
  2. populating combobox based on another combobox selection
    By bqheng in forum Word Programming / VBA / Macros
    Replies: 7
    Last Post: 08-24-2015, 08:52 AM
  3. Populating Combobox based on Combobox selection from EXCEL worksheet
    By JChaney17 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-04-2014, 08:14 AM
  4. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  5. Populating combobox 2 with items that match criteria from combobox 1
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-13-2013, 03:00 AM
  6. Removing Duplicates from ComboBox and Populating one combobox based on another
    By kbmtech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2010, 11:17 PM
  7. Populating the list in a combobox based off the value chosen in another combobox
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2010, 11:50 AM

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