I have an array that contains a list of names, for example: ORB160, WP_ELEC, S_ELEC, EE
I have a VBA code that first sorts the array in ascending order, then does some data muniplulation, and finally output the results to a worksheet. The output headings contain the array list, for example:
B1 C1 D1 E1
A1 EE ORB160 S_ELEC WP_ELEC
Note that the headings are sorted.
What I want to do is re-arrange the data in each column based on the original list of names in the arrays. In this example, this would be:
B1 C1 D1 E1
A1 ORB160 WP_ELEC S_ELEC EE
So the solution would be to move column E to B, and then move column C to D. However, I’m looking for a more generic VBA to do this since the order and the list of names in the array can change.
Can someone provide me with some help on getting this done?