How do I Loop Through A Sorted Excel Range in VBA in the Order I Sorted It In?
I am using VBA to sort a filtered worksheet in Excel 2010. Visually, the sort works, but when I step through the sorted, filtered range in VBA it appears that the range is still in its original order. For my purposes, this is not desired.
Here is an excerpt of my looping code:
For r = 2 To LastRow Set row = ws.Range(r & ":" & r) Debug.Print row.Row Next
Use autofilter mode=false to clear the filter then try sorting.