+ Reply to Thread
Results 1 to 5 of 5

named range based on cell text in vba

  1. #1
    Forum Contributor
    Join Date
    09-09-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    102

    named range based on cell text in vba

    Hello,

    I am trying to create a named cell range based on the value within a range i.e. if in cell range a1:a20 cells contain the text of J.K.Rowling they will be part of a named range called Author.

    Is that possible, either through named ranges or VBA?

    Thanks

    Z

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: named range based on cell text in vba

    Here is the code..
    Please Login or Register  to view this content.
    Change red portion accordingly..
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: named range based on cell text in vba

    Do you mean that if one ore more of the cells in A1:A20 has "J.K. Rowling" in it then you want to name the whole range "Author"?

  4. #4
    Forum Contributor
    Join Date
    09-09-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    102

    Re: named range based on cell text in vba

    No sorry, I mean if there are two cells with "J.K.Rowling" in e.g. a3 and a7 then these 2 cells would become a named range called authors.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: named range based on cell text in vba

    Hi,

    Does this help?

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

+ 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 based on cell text
    By zak.horrocks in forum Excel General
    Replies: 1
    Last Post: 12-02-2014, 12:07 PM
  2. Need to Populate a Text box with a named range based on a value in a Dropdown Box.
    By Bob Folks in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2014, 01:23 PM
  3. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  4. Replies: 6
    Last Post: 10-14-2009, 03:01 AM
  5. Replies: 1
    Last Post: 06-03-2006, 10:55 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