Hi Rodgy,
. Alan S already had you "Sort ed" as I was in the middle writing this....
.....so I finished it anyway as an alternative...
.. it is the typical "Array capture" type alternative method to Alan S#s "Spreadsheet" type method (Which i actually prefer as it is easier as a beginner to follow). But theoretically mine is faster for lots of data (I think?) - (It captures all data in one go, does all sorting in VBA as it were, then outputs end results in one go)
... here it is (and I modified it for your new requirements. ). (Try to get your requirements right first time as it is not always easy to modify and sometime means re- writing everything again (I was lucky here, and the modifications were easy)
Here then the code:
……. And just in case you want empty cells to be ignored, a second version
…
Hope that helps.
Alan E
P.s. (By the way, I expect a formula could do this for you.. unfortunately I am not very good with those..)
Bookmarks