+ Reply to Thread
Results 1 to 7 of 7

Named Range Based on Column Header

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    4

    Named Range Based on Column Header

    Hello,

    I am looking to automate a process where I can have a named range (entire column) where the name of that range will be the value in Row 1 of that column.

    ActiveCell.Columns("A:A").EntireColumn.Select
    ActiveWorkbook.Names.Add Name:="Cell A1", RefersToR1C1:= _
    "='Sheet1'!C1"

    I want "Cell A1" to actually be the value of that cell.

    Can anyone help?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Named Range Based on Column Header

    Assuming you are only going to be doing this for column 1

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-10-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Named Range Based on Column Header

    Thanks for the reply buy I am going to be doing this for 50 columns so I do not want to hard code any cell references. What reference should I use. Thanks!

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Named Range Based on Column Header

    What 50 columns are you doing this for and are they going to be the same columns every time?

  5. #5
    Registered User
    Join Date
    07-10-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Named Range Based on Column Header

    It will be the first 50 columns of the sheet. This range will expand to more columns over time.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Named Range Based on Column Header

    As the range expands over time you can adjust it accordingly.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-10-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Named Range Based on Column Header

    Thanks your for all of your help!
    Last edited by kcguyton; 05-29-2013 at 12:16 PM.

+ 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