+ Reply to Thread
Results 1 to 7 of 7

Naming Range Between Top & Bottom Borders (2)

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Naming Range Between Top & Bottom Borders (2)

    Hi Guys

    I'm need some help in Naming ranges that have borders around them.

    Ranges Start in Column A and extend to Column J.

    The macro needs to look in Column A for a Top Border - set this as the top row for the range to be named, then find the 2nd Bottom Border in Column A - set that as the bottom Row for the named range.

    The name for the range is found in the Top Row of Column A.

    the values in these Cells are always Names i.e. "John Smith". (With the space)

    I need the names for these ranges to be saved as "John_Smith" (Space replaced with _)

    This should run everytime the current worksheet changes to a WS who's name is in ##-##-#### format

    I've asked similiar questions in the past, however this is a different question and I feel warranted starting a new thread: http://www.excelforum.com/excel-prog...red-cells.html


    regards
    Last edited by jordan2322; 06-02-2012 at 12:09 AM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Naming Range Between Top & Bottom Borders (2)

    do you have an example sheet? is there any reason you have to work through this with a macro (and can't design the name to work with a formula that can expand to fit the table....)


    -- Another point

    If you do indeed need to use a macro, are you looking to define a static range like A3:j57 or are you looking to define a dynamic one like $A$3:INDEX($3:$100, counta($A$3:$A$100),10)
    Last edited by GeneralDisarray; 05-30-2012 at 07:10 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Naming Range Between Top & Bottom Borders (2)

    I need a macro to do this for me, the ranges are not static - the macro is run weekly on a new WB which has different ranges as previous week.

    Please see attached WB
    Attached Files Attached Files
    Last edited by jordan2322; 05-30-2012 at 09:18 PM.

  4. #4
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Naming Range Between Top & Bottom Borders (2)

    Any help with this one would be very much appreciated.
    Last edited by jordan2322; 06-03-2012 at 10:26 PM.

  5. #5
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Naming Range Between Top & Bottom Borders (2)

    See if this works for you.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Naming Range Between Top & Bottom Borders (2)

    Thank you StevenM. One issue though - its not naming the last range when its found?
    I think it has to do with the range that it is searching for the last used cell on..

    I've tried using..
    Please Login or Register  to view this content.
    which finds the correct last Row

    Regards
    Last edited by jordan2322; 06-04-2012 at 07:53 PM.

  7. #7
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Naming Range Between Top & Bottom Borders (2)

    Yes, you are correct.

    Instead of:
    Please Login or Register  to view this content.
    Which finds the last row of data in column A. In your situation:
    Please Login or Register  to view this content.
    would have been better.

+ 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