I have several very long arrays which need to be sorted alphabetically based on user action, but for simplicity I'll use the following example:
Dim Name as Variant, Street as Variant
Name = array("B", "C", "D", "A", "E")
Street = array("1", "2", "3", "4", "5")
After the user clicks the sorting button, the Name array now has the following order
("A", "B", "C", "D", "E")
and I then need to sort the Street array, so it gets the corresponding order, i.e.
("4", "1", "2", "3", "5")
What is the most efficient way to do this in VBA?
Please notice: I know how to sort an individual array normally in VBA, I'm only looking for answers that involve sorting an array based on another array. Thanks.