+ Reply to Thread
Results 1 to 4 of 4

Sort working OK but adjacent value column not

  1. #1
    Forum Contributor
    Join Date
    04-16-2016
    Location
    bognor
    MS-Off Ver
    Pro-Plus 2016
    Posts
    153

    Sort working OK but adjacent value column not

    Hi all,The code below sorts the figures out in each block of rows then places the position of that figure in the adjacent column,like this where the smallest number is 1 second smallest 2 and so on.
    CI CJ
    1 24
    2 26
    3 29
    4 34
    5 35
    6 37


    Please Login or Register  to view this content.
    the problem arises when there are identical numbers(two or more in col j).In the following eg there are three identical
    numbers in3, 4 and 5.And the code does a good job of placing them as all 3rd in position,but then instead of the final cell(184) being 4th it presents as 6th.Likewise if cells 1,2,3 were identical cell 4 would then present itself as 4th as opposed to 2nd,and so on.
    1 143.0
    2 144.0
    3 145.0
    3 145.0
    3 145.0
    6 184.0
    does anyone have any suggestion as to modify the code to ensure that the cells values in the J cells are correctly reflected in th I cells adjacent
    Kind RegardsBIF

  2. #2
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Sort working OK but adjacent value column not

    Hi,

    Why can't you just write integers chronologically in the adjacent row? After the data is sorted, delete the integer row and just add consecutive numbers. That might be a lousy solution but might be all you need.

    Please provide a sample workbook showing BEFORE, AFTER, and CURRENT results.

  3. #3
    Forum Contributor
    Join Date
    04-16-2016
    Location
    bognor
    MS-Off Ver
    Pro-Plus 2016
    Posts
    153

    Re: Sort working OK but adjacent value column not

    Hi IronFelix,
    Thanks for the reply. The blocks of six(or less) rows that are divided by an empty row that can run in hundreds of blocks.Typing in manually would take quite a long time
    The code written so far manages a sort of hybrid chronology,but is not accurate because if identical numbers appear in the designated column (J here) although the postion column will identuify them as 1,2,3rd ect,it misses out the next chronological sequence.So if there were 3 identical number one's the next should be number two,but instead it shoots up to number 4.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Sort working OK but adjacent value column not

    Barrowinfurnace - Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question. If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    If you have less than 10 posts, do not try to copy and paste the link. Instead, type the link out in your thread.

    No further help to be offered, please, until the OP has complied with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Replies: 1
    Last Post: 03-29-2018, 07:58 AM
  2. Need to Sort Column Data - Horizontal Sort Not Working
    By Jadd in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-01-2016, 07:09 PM
  3. [SOLVED] New to arrays-BubbleSort code(Working)-How do I edit to sort by 2nd column then 3rd?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2013, 06:29 AM
  4. Replies: 3
    Last Post: 07-30-2012, 11:20 AM
  5. Replies: 1
    Last Post: 05-12-2012, 04:56 AM
  6. Replies: 6
    Last Post: 09-08-2010, 04:49 PM
  7. Replies: 6
    Last Post: 03-04-2006, 07:30 AM

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