+ Reply to Thread
Results 1 to 5 of 5

Populate a combobox in a userform with a dynamic range.

  1. #1
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Populate a combobox in a userform with a dynamic range.

    I have a combobox in a userform, and I would like for the options to be from a dynamic range within my workbook. Generally, I use this code to make it work:

    Please Login or Register  to view this content.
    This code has worked fine, but I have recently hit a snag. If I am viewing a different worksheet than the range is on, I get an error. This is a problem because I have information on a hidden worksheet that I would like to populate the combobox. Does anyone have any suggestions?

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

    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481
    Hi there,

    Please Login or Register  to view this content.
    Sorry, but I doubt that that code EVER worked, because there are two errors in it - there's a missing A, and one set of quotes is not closed.

    I think the correct version should be:
    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Roy:

    Your code worked perfectly, thank you.

    Greg:

    I did copy my code over incorrectly. Your solution works as well.

    Problem resolved.

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481
    Hi again,

    Thanks for the feedback. You're welcome - glad to have helped.

    All the best,

    Greg M

+ 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