I have two different columns on Excel. I want to create a script that will sort Column F, (Have a header) and will sort Column B based on where Column F's sort worked out. (Without affecting any other columns however!)
So if I have
ColB ColF
1. Cat 2
2. Mouse 1
3. Dog 3
The sort will give me
ColB ColF
1. Mouse 1
2. Cat 2
3. Dog 3
How can I do this? I tried recording a macro of just sorting it out, but I get an error saying "The command cannot be performed with multiple selections, Click a single range and try again"
The easiest way I can think of is to temporarily copy over your two columns into a vertical look-up table with column F on the left.
Then sort your column F and update column D with VLookup with the format like:
Then if you want to delete the temp table, just make sure you replace column D's formulas with values.
You can do all of this with a macro it just has several steps. I could write it for you, but that isn't really what Stackoverflow is about.
Have fun. :-)