Share via

Macro not sorting correctly

Anonymous
2018-03-07T15:16:19+00:00

In Excel 2010 I created a macro for a csv file, and sorted by a date/time field. It seems to sort fine until the bottom where it adds in earlier entries that are out of chronological order. Upon the first run of the macro the sorting is correct, upon each subsequent run more out of order date/times get added to the bottom. Does anyone know what might be causing this?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2018-03-07T19:09:23+00:00

    I think I figured it out, when I recorded the macro there were less rows than subsequent runs (as each run of the csv has more data than the last). Once I increased my rows in the code upon subsequent creations as row count increases they are being captured in the sort.

    Was this answer helpful?

    0 comments No comments