+ Reply to Thread
Results 1 to 5 of 5

Keep row number after a sort

  1. #1
    Registered User
    Join Date
    03-08-2019
    Location
    NEW JERSEY
    MS-Off Ver
    2019
    Posts
    74

    Keep row number after a sort

    I have a spread sheet with about 15000 records in the sheet. I added a new column and added the numbers for each row.
    When I do the sort, the field with the numbers do not move (i.e. record 200 still shows up as number 1).
    I tried doing the sort from the home tab and clicking on Sort and filter, but the record number does not change.
    If I click on the Data tab and click on sort, again the number does not move.
    I tried cutting out about 100 records and trying it and it works correctly.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Keep row number after a sort

    Hi fatfish,

    Excel sorts tables of data. If you have a blank column between your data and the row number column, it won't sort the numbers. Take all those completely blank columns out and try again.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  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,630

    Re: Keep row number after a sort

    Where is the new column? Is it included in the sort range? How did you add the row numbers for each row? Did you use a formula? If yes, what is it?


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    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


  4. #4
    Registered User
    Join Date
    03-08-2019
    Location
    NEW JERSEY
    MS-Off Ver
    2019
    Posts
    74

    Re: Keep row number after a sort

    The first 14 rows were hidden and there were no values in the first 2 fields in all 14 columns.
    I put dummy information in the 14 rows and tried to sort it again.
    Now it works the way that I wanted it to.
    (Simple solution).

  5. #5
    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,630

    Re: Keep row number after a sort

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Sort Number within a cell
    By chintamani.avinash in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-18-2022, 07:22 AM
  2. How to sort serial number - based on another sheet serial number order
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2021, 08:30 AM
  3. [SOLVED] Sort listbox by number
    By Tonyhansson in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-15-2021, 02:42 PM
  4. [SOLVED] Sort With Number and Word
    By amir0914 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2018, 12:20 AM
  5. Sort according to number
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2015, 03:42 PM
  6. Sort Text & Number
    By Irina in forum Excel General
    Replies: 4
    Last Post: 11-28-2006, 12:44 PM
  7. Sort by number not by letter (C1, A2, B3, D4)
    By dukemeiser in forum Excel General
    Replies: 3
    Last Post: 05-04-2006, 09:45 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