I work on writing the excel Add-In using Excel Interop. I want to get original row index after using sort in Excel. For example:
Original Text in Excel:
A B
1 Name Country
2 Douglas CA
3 Alice US
After Sort:
A B
1 Name Country
2 Alice US
3 Douglas CA
Orginal named “Douglas” row index is 2. After sorting row index is 3.
How to get original row index(the row index is 2) after sorting?
You cannot find back the original index after you’ve done the sorting because it is too late. Excel doesn’t store the history.
Some tips to solve this: