+ Reply to Thread
Results 1 to 3 of 3

Using declared range in .SetRange

  1. #1
    Registered User
    Join Date
    08-15-2008
    Location
    London
    Posts
    11

    Question Using declared range in .SetRange

    Afternoon all,

    I've got a range declared using the following:

    Please Login or Register  to view this content.
    ...and now I want to use that named range to limit how far a sort can be applied.

    The sort code I'm using is:

    Please Login or Register  to view this content.
    ...which gives me a Run-time error '1004': Method 'Range' of object '_Global' failed

    Can someone tell me where I'm going wrong here please?

    Many thanks as always,

    Peter

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using declared range in .SetRange

    Hi. MisterPan,

    instead of
    Please Login or Register  to view this content.
    use either
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Using declared range in .SetRange

    Late entry:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Do/Loop Until using variables declared
    By LLL0422 in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 06-05-2014, 09:01 AM
  2. [SOLVED] Variable declared as long out as text
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 09:06 AM
  3. array names declared on the fly
    By GunNam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2010, 10:22 PM
  4. .SetRange question
    By telstrareg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2008, 12:51 AM
  5. Non-declared variable
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2007, 10:01 AM

Tags for this Thread

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