+ Reply to Thread
Results 1 to 7 of 7

validating Comboboxes Using named ranges

  1. #1
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    185

    validating Comboboxes Using named ranges

    Hello i have some code to validate a combobox in excel. But instead of listing all the options, could i point it to a named range and check if it matches any of those. Then if i update the Named range i wouldn't need to update the code?

    Please Login or Register  to view this content.
    The named range is called PaymentMethodTable that lists all those methods.

    thank you for any help given

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,371

    Re: validating Comboboxes Using named ranges

    Hi Ultimateneo,

    Yep, you can do that. See my example where I've created a Dynamic Named Range of cells in column A. Then the userform's ComboBox's RowSource property uses that DNR. See the attached to see it all work. Add a few names and then click on the Button 2 again.

    I hope my example is close to what you want..

    ComboBox on Userform from DNR range.xlsm

    To get to your full answer you might need to read:
    https://stackoverflow.com/questions/...-does-not-work
    Last edited by MarvinP; 06-15-2019 at 01:12 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: validating Comboboxes Using named ranges

    Maybe something like this.

    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.

  4. #4
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    185

    Re: validating Comboboxes Using named ranges

    Thank you I will try the solutions out on Monday

  5. #5
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    185

    Re: validating Comboboxes Using named ranges

    Hello i tried your code but it just seems to bypass it. i have attached the full code for validation. How to get your code to run in the elseif ?

    Please Login or Register  to view this content.

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

    Re: validating Comboboxes Using named ranges

    Try this.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    185

    Re: validating Comboboxes Using named ranges

    Thanks will try, sadly the computers haven't been working so very limited time on them. Hopefully fixed tomorrow. Bad weather

+ 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. [SOLVED] VBA creates named ranges, but named ranges disappear
    By BrotherNeptune in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2015, 03:22 PM
  2. Define only 2 named ranges from a list of named ranges...
    By abhi900 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2014, 04:20 AM
  3. [SOLVED] Cascading Comboboxes With Multiple Dynamic Named Ranges?
    By spamad in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-20-2013, 10:52 AM
  4. Comboboxes and dynamic named ranges
    By SPACKlick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-18-2012, 09:43 AM
  5. Populating comboboxes and ranges through a class module
    By Mats Samson in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-08-2011, 01:14 PM
  6. Validating Multiple Ranges
    By HappyHole in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2011, 06:53 AM
  7. Validating IP ranges / text
    By rokuk in forum Excel General
    Replies: 2
    Last Post: 02-04-2008, 04:38 PM

Tags for this Thread

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