+ Reply to Thread
Results 1 to 7 of 7

Automatically sort a range

  1. #1
    Registered User
    Join Date
    02-24-2016
    Location
    rio
    MS-Off Ver
    2010
    Posts
    16

    Automatically sort a range

    Hi! In my spreadsheet I have a range of cells which I am sorting by one column then another and then another. When I put data into other cells which effect the results I am sorting I have to select the area again and custom sort. Is there a way to make those cells automatically sort when the data changes?

    Thanks!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically sort a range

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    02-24-2016
    Location
    rio
    MS-Off Ver
    2010
    Posts
    16

    Re: Automatically sort a range

    The data I want to sort is on sheet 2...from B2 to K20. I am sorting by points (column d) then 1st 2mds 3rds etc. So that the names are in order of position.

    Thanks a lot!
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically sort a range

    Try this in your Sheet2 module:

    Please Login or Register  to view this content.
    * And save the book as macro-enabled
    Last edited by xladept; 02-24-2016 at 10:14 PM. Reason: Added event code

  5. #5
    Registered User
    Join Date
    02-24-2016
    Location
    rio
    MS-Off Ver
    2010
    Posts
    16

    Re: Automatically sort a range

    Hi! Sorry I couldn't work out what I am meant to do! I have never used a macro before, could you explain how I should create it? Thanks!

  6. #6
    Registered User
    Join Date
    02-24-2016
    Location
    rio
    MS-Off Ver
    2010
    Posts
    16

    Re: Automatically sort a range

    Worked it out, cheers!

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automatically sort a range

    Glad you worked it out - here's what I post when I realize that someone may not have used macros before:

    If you haven't used macros before you'll need to go to:
    File- options - trust center -trust center settings - macro settings ,
    the second option down (disable all macros with notification)
    '[email protected]
    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name

    *But in your case we want to put the code in the Sheet2 Class module

    because events can't be attached to standard modules

+ 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. Macro code to automatically sort column by date range
    By holmit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2016, 07:18 AM
  2. Cannot Sort Range VBA - "Unable to get sort property of range class"
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2015, 04:51 PM
  3. [SOLVED] Automatically Sort
    By jewellove in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-03-2013, 08:58 PM
  4. automatically sort row
    By etheer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 04:57 AM
  5. sort button - how to sort large range in boxes
    By jw01 in forum Excel General
    Replies: 2
    Last Post: 03-06-2012, 09:35 PM
  6. Select 1st 2d range, sort, find 2nd, sort, etc
    By finny388 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-24-2011, 03:12 PM
  7. Sort automatically
    By retunit3 in forum Excel General
    Replies: 1
    Last Post: 06-30-2008, 01:26 AM

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