+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Excel 2007 - Named range disappears in sort macro

  1. #1
    Registered User
    Join Date
    12-26-2006
    Posts
    78

    Excel 2007 - Named range disappears in sort macro

    I have several named ranges which are sorted individually. These ranges change, ie rows are added and deleted, hence the need for named ranges. Have been using this extensively in 2003 without any issue.

    Now I've recorded a macro in 2007 to sort ranges, however within the actual macro, though it starts with Goto Reference:="dataA" (dataA = named range), the actual sort refers to columns & rows, ie B4:F70.

    The range in the example above has grown to B4:B95, but is only being sorted up to row 70 as per the macro.

    What can I do to keep the named range as the sort range within the macro?

    Bungaree

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Post the code?

  3. #3
    Registered User
    Join Date
    12-26-2006
    Posts
    78
    SHG,

    I made the earlier one up, as the situation of several ranges is actually at work and I'm at home.

    I discovered the 2007 problem in the macro below. I must have recorded it when there were 240 records and it was only sorting 240 rows though I had inserted about 50 more - I've solved it for this particular worksheet by making the range far larger than I'll ever need - a quick (ugly) fix for this one.

    I do have other situations where the range needs to be flexible and would like to know why 2007 is causing probs with this.

    Thanks in anticipation!
    Bungaree
    Please Login or Register  to view this content.
    Last edited by royUK; 07-13-2008 at 03:15 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    bungaree

    You need to read the Forum Rules & use Code Tags when posting code. I will add them this time, but next ime you my find your post closed.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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