+ Reply to Thread
Results 1 to 4 of 4

VBA code for Sort Ascending to specified area

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    Portland, OR
    MS-Off Ver
    Microsoft 365
    Posts
    50

    VBA code for Sort Ascending to specified area

    Hello,

    I'm struggling with figuring out how to sort an area in my sheet. I'm running several other macros before I need to complete the sort. Once I get to the sort, I have been struggling with it sorting correctly. It seems to keep sorting only a portion of my data and it's incorrect. I'm open to creating its own macro to embed in my larger macro, or just a few lines of code to add.

    The number of rows varies, so I can't specify an exact number of rows, but I also need to sort Columns N through Y, using the Y Column as my key. Also, my data does not begin on Y1. I have a title in Y3 and then the data begins in Y4. So, realistically, I need to sort N4:Y(Undeteremined) with my titles in Row 3.

    I hope this makes sense. I've attached a sample workbook in hopes that this gives an idea of what I'm trying to accomplish.

    Your help is EXTREMELY appreciated.

    Thanks in advance,

    Tyler
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,553

    Re: VBA code for Sort Ascending to specified area

    Isn't it just
    Please Login or Register  to view this content.
    ?

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    Portland, OR
    MS-Off Ver
    Microsoft 365
    Posts
    50

    Re: VBA code for Sort Ascending to specified area

    Hey jindon,

    Thanks for the response, I really appreciate it.

    I have tried a dozen different methods and canNOT figure it out, so I am grateful for your input.

    That being said, I tried your line on the Example Book I provided and it worked great, however, when I plug it into my master file, the ranking is not in order!!? I don't understand.

    This is the order that resulted once I plugged it into my actual workbook:

    Total Rank
    1
    2
    3
    4
    9
    5
    6
    6
    6
    14
    11
    10

    I have no clue how this is even possible. Any thoughts?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,553

    Re: VBA code for Sort Ascending to specified area

    If the layouts and the data type are the same as workbook posted, it should sort properly, so something must be different.

+ 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] Code For Sort out By Ascending Order
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2016, 09:53 AM
  2. VB Code to sort the list in ascending order
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2015, 12:08 PM
  3. Sort the final digits and sort in ascending order
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2014, 11:58 AM
  4. Challenged: ascending sort within custom sort
    By jhren in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2013, 12:35 PM
  5. Ignoring Blank Cells in an Ascending Sort VBA Code
    By Simon.Ward in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2013, 11:36 AM
  6. [SOLVED] Sort ascending in Column P (Secret Code) with variables row
    By fang603 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2012, 09:44 AM
  7. Sort Ascending
    By jhc8255 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2011, 01:02 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