+ Reply to Thread
Results 1 to 4 of 4

sort by selection vba error

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    182

    sort by selection vba error

    Hi, trying to sort by cell color and want to select areas to be sorted with mouse and then run the sort routine:
    Please Login or Register  to view this content.
    I get an Picture1.png error related to this line of the code:
    Please Login or Register  to view this content.
    I'm sure something simple I'm missing.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: sort by selection vba error

    Hi Bob- SelRange is a range OBJECT, so you don't need the Range method, just use the variable name.
    Please Login or Register  to view this content.
    Please click the Add Reputation star below any helpful posts, and use Thread Tools (up top) to mark your thread as SOLVED once you have your answer. Thanks!-Lee
    Last edited by leelnich; 08-09-2017 at 02:11 PM.

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    182

    Re: sort by selection vba error

    Ahh!
    Thanks very much!

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: sort by selection vba error

    You're most welcome! If complete, please mark your thread as SOLVED (Thread Tools, up top) - Thanks Lee
    BTW, I just updated the code (a little tighter).

    Please click the Add Reputation star below any helpful posts, and use Thread Tools (up top) to mark your thread as SOLVED once you have your answer. Thanks!-Lee

+ 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. [SOLVED] VBA - Sort selection on inactive sheet
    By ormerods in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-20-2013, 11:30 AM
  2. Sort based on a selection.
    By Eliat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2013, 08:17 AM
  3. [SOLVED] Sort a selection by Bold first
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-13-2012, 07:42 AM
  4. Excel 2007 : How to sort a worksheet selection that won't sort
    By crossroadsglass in forum Excel General
    Replies: 0
    Last Post: 02-06-2012, 07:17 PM
  5. How to sort a selection of rows?
    By jgmiddel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2008, 04:39 AM
  6. Sort direction selection
    By nolloping in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2007, 06:44 AM
  7. [SOLVED] Sort Selection
    By ibbm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2006, 05:10 PM
  8. Selection.Sort error
    By Krager in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2005, 02:05 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