+ Reply to Thread
Results 1 to 5 of 5

VBA won't sort sheet

  1. #1
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    VBA won't sort sheet

    I need help with this VBA code, it's not sorting the sheet.

    At first my Ranges were cell specific so I tried adjusting to get the LastRow info so that it would sort all the data instead of just the max row when I had recorded the macro, BUT it was at least sorting.

    When I tired adding the Lastrow pieces, it doesn't sort at all now...

    HELP thanks everybody!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA won't sort sheet

    Ranges like:

    Please Login or Register  to view this content.
    Don't really exist...or they do... but imagine lastrow is 200... that just means you are sorting Range("D2200"). Perhaps you mean:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA won't sort sheet

    *facepalm I changed it all to
    Please Login or Register  to view this content.
    , but it's still not sorting.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA won't sort sheet

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    03-26-2018
    Location
    Maryland
    MS-Off Ver
    2016
    Posts
    29

    Re: VBA won't sort sheet

    Got it! had to change the very last Range to "A1:K1" & Lastrow.

    thank you

+ 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. VBA/Macro to Automatically Update, Copy, & Sort information from Sheet 1 to Sheet 2
    By E9demello in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2017, 09:37 AM
  2. [SOLVED] vba code to sort data in two sheets and copy and paste sort data in output sheet
    By UPA in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2017, 05:13 AM
  3. [SOLVED] Excel 2016 Sort routine issue - recording macro has sheet name in sort routine
    By pongmeister in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2016, 02:45 PM
  4. match/sort - lookup data from one sheet and link to other sheet -
    By javaidmr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-11-2015, 10:04 AM
  5. Sort sheet, highlight, undo sort
    By js.raju in forum Excel General
    Replies: 1
    Last Post: 11-16-2013, 05:51 PM
  6. [SOLVED] Sort Functions are Disabled When Sheet is Protected, and more Issue When Sheet is Shared
    By bssol in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2013, 05:33 AM
  7. Macro to Look for Sheet, create if none, sort items from master & copy to new sheet.
    By ali.whitaker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2012, 12:58 PM

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