+ Reply to Thread
Results 1 to 4 of 4

Exclude values that contain text from a named ranged vba

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    138

    Exclude values that contain text from a named ranged vba

    Hi All,

    I have a combo box in a user form that I would like to populate with the values contained in a named range. I am currently using RowSource - ShipNumber.

    ShipNumber is the dynamic named range in column A of my spread sheet. Typical data in this range could look like this:

    1
    2
    3
    1A
    1B
    2A
    4
    5
    1C
    3A

    The combo box list I am trying to achieve should exclude all numbers that contain text to achieve a result like this:

    1
    2
    3
    4
    5

    Numbers can be anywhere from 1 to 10 digits long and the text suffix will always be only one letter - "A", "B", "C", "D" or "E".

    I have tried many variations of different approaches found online but have not been able to find anything that specifically targets this issue.

    Is there a dynamic named range formula or other method, perhaps a vba solution upon initialisation of the user form, that could achieve this?

    Many thanks in advance!

    Regards,
    Dave C

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Exclude values that contain text from a named ranged vba

    One way would be to use specialcells

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Andy Pope; 07-17-2015 at 11:50 AM.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Exclude values that contain text from a named ranged vba

    A List method is another route.
    Please Login or Register  to view this content.
    For kicks, this is a fun one.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 07-17-2015 at 12:10 PM.

  4. #4
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    138

    Re: Exclude values that contain text from a named ranged vba

    Hi Andy,

    Special cells was a great solution and I have incorporated it into my macro. Many thanks for such a quick response and apologies for such a slow reply!

    Kenneth, thanks also for your response. I have not been able to test your two solutions but appreciate your input. It's still good to have these for future reference!

    Regards,

+ 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. Named Range to exclude cells if it contains specific text
    By Viktor86HUN in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-06-2015, 08:05 AM
  2. named ranged within named range
    By dluhut in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-12-2014, 01:47 PM
  3. [SOLVED] named ranged - offset & counta
    By milo1984 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2014, 02:13 AM
  4. [SOLVED] AVERAGEIFS & Named Ranged Inputted Criteria
    By tskabo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 08:19 PM
  5. sumproduct on named ranged giving #VALUE! error
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2011, 10:02 PM
  6. Lookup Two Named Ranged
    By yawnzzzz in forum Excel General
    Replies: 3
    Last Post: 09-24-2010, 03:10 PM
  7. Replies: 2
    Last Post: 06-01-2005, 01:05 PM

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