+ Reply to Thread
Results 1 to 3 of 3

Create a named range for each cell in a selected area

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    London
    MS-Off Ver
    Excel 2003 Excel 2010
    Posts
    189

    Create a named range for each cell in a selected area

    Dear all, my question is how to create a named range for each cell in a selected area.

    I first select the area of cells and then run the macro. Each cell in the selected area will have named ranges using the related column name (1st row on top) and row name (1st column on the left).

    I attached an example here. So cell B2 will be named as Y2011Sales (just a combination of the names of related column and row).
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Create a named range for each cell in a selected area

    Try this
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    London
    MS-Off Ver
    Excel 2003 Excel 2010
    Posts
    189

    Re: Create a named range for each cell in a selected area

    Hi davesexcel, that macro works nicely thank you.

    Can I ask if Range("B2:C3") can be adapted slightly to make it more flexible? So the range is just based on the area selected manually, not fixed beforehand as B2:C3.

    It is ok if this is not possible.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Create a named range for each cell in a selected area

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    should do the trick.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    London
    MS-Off Ver
    Excel 2003 Excel 2010
    Posts
    189

    Re: Create a named range for each cell in a selected area

    Many thanks, davesexcel. The macro works perfectly. 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. VBA Create a named range based on cell value
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2013, 03:30 PM
  2. [SOLVED] Need Macro to Create New Worksheet Named After Currently Selected Cell
    By logabr01 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2013, 01:42 PM
  3. [SOLVED] Create named range for each cell
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2012, 11:16 AM
  4. Create a dynamic range on named cell?
    By garyi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2011, 04:06 PM
  5. Selected Cell within named range?
    By negcx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2008, 09:08 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