+ Reply to Thread
Results 1 to 12 of 12

Automatically define Range

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

    Cool Automatically define Range

    Hi guys,

    I need a way to automatically look at a given worksheet in Column A for a Top Border, then go to the next row until a Bottom border is found and define that range to Column H as the value found in the Upper Left cell minus any spaces that cell contains

    Cheers
    Attached Files Attached Files
    Last edited by jordan2322; 11-29-2011 at 07:27 PM.

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Automatically define Range

    Have you looked into dynamic named ranges? They allow for the growth of data. If dynamic named ranges do not seem to suit your needs, please upload a sample workbook with a more detailed explanation on your intent and purpose.

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

    Re: Automatically define Range

    I've just had a look into it then, but how would i use this if I had Multiple Dynamic Ranges that would start and finish one after the other in column A?

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

    Re: Automatically define Range

    How do i modify the following code such that the naming of the selected range works correctly?

    Please Login or Register  to view this content.
    Thnx
    Last edited by jordan2322; 11-29-2011 at 12:06 AM.

  5. #5
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Automatically define Range

    Here is an improved version of your code:

    Please Login or Register  to view this content.


    The code to cycle through Column A and add named ranges, based upon border, is:
    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: Automatically define Range

    Thanks Heaps Whizbang!

    Is there a method to organise all named ranges into a given order set out on a different worksheet?

    Also, Please see the updated attachment file: How do I get this to define from column A to Column H - at the moment it only defines A:A

    Please Login or Register  to view this content.
    thnx
    Last edited by jordan2322; 11-29-2011 at 04:50 PM.

  7. #7
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Automatically define Range

    Please Login or Register  to view this content.


    Quote Originally Posted by jordan2322
    Is there a method to organise all named ranges into a given order set out on a different worksheet?
    I am not sure what you mean. Do you want to reproduce the data on another sheet, sorted by Name? Or just list the names in alphabetical order?

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

    Re: Automatically define Range

    Yes i want to reproduce the data onto another sheet sorted in the following order:

    Dave Wilkinson
    Ian Wood
    Mick Attkinson
    Shane Cox
    Brett Jones
    Lee Kelly
    Steve Kowal
    Scott Paine
    Andrew Richardson
    Gary Nelson
    Peter Baxter
    Bryan Harris
    Jeff Percival
    Lance Houghton
    Warren Gardner

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

    Re: Automatically define Range

    Although this is the same order as what is currently there I will eventually be using the same code on another wookbook which will have different names to this one.

  10. #10
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Automatically define Range

    How is this list sorted? It is not alphabetical. For a custom sort, you would need some sort of helper information that designates the order.

    You could try "Picture Links" that reference the named ranges.
    http://blog.drscottfranklin.net/2008...-picture-link/

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

    Re: Automatically define Range

    Couldnt I do something like this:

    Please Login or Register  to view this content.
    I've created a new worksheet titled "manifest" which contains the list of names previously posted above
    I've also created a new worksheet titled "TempSH" which i'll paste the ranges into order on, then i'll delete the original worksheet. Will this method work and what do i need to change in the code to achieve this?

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

    Re: Automatically define Range

    Solved.

    Please Login or Register  to view this content.
    Using a 'Manifest' sheet with the desired order i wish to use the ranges are found and pasted into order.

    thanks for your excellent help Whizbang!!

+ 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