Thank you choroba. Your solution seems to work just fine with my real data.
In reply to Re^2: Find range in coordinates array by IB2017 in thread Find range in array with indices by IB2017