+ Reply to Thread
Results 1 to 4 of 4

Sorting an Area

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    35

    Sorting an Area

    I am trying to sort a range but defined by the Row number of a Named Cell "SheetAreaEnd"

    The Code I am using is

    Please Login or Register  to view this content.
    This however gives an error "Run-time error '1004'


    If I fix the Range using the code below then it works correctly

    Please Login or Register  to view this content.

    I can select the correct area using the code

    Please Login or Register  to view this content.

    Hoping someone can spot the error I have made !

    Many thanks
    Mike

  2. #2
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Sorting an Area

    Hello. I imagine that you intend that the expression:

    Range("SheetAreaEnd").Row


    return the number '20'.

    However, what it will return is the number of the first row of the named range 'SheetAreaEnd': That's your mistake!...
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Sorting an Area

    Thanks for this.
    Sorry I should have said that the Range "SheetAreaEnd" is actually one cell at the end so giving a Raneg to Sort of C9:AL20

    Mike

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Sorting an Area

    Upload your sample workbook to the Forum because as far as I can see nothing indicates that you are going to have an error.

+ 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. Sorting Area Codes into time zones
    By 3dw4rd3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-01-2013, 04:54 PM
  2. Sorting data from a column to corresponding area
    By alex.ransome in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2013, 06:59 AM
  3. area sorting from a given list (CHALLANGING)
    By sailesh9630 in forum Excel General
    Replies: 8
    Last Post: 06-17-2011, 08:01 AM
  4. [SOLVED] sorting data to new area on sheet
    By Ian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-17-2006, 02:50 PM
  5. [SOLVED] Sorting data to a 'print' area ??
    By Ian in forum Excel General
    Replies: 0
    Last Post: 03-16-2006, 04:15 PM
  6. [SOLVED] Sorting Area with Merged Cells
    By prizm1 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 09-10-2005, 08:07 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