I have a row of stock symbols at the top of my Excel 2007 workbook, call it row A. Several rows below this I have a numeric value for each stock symbol, based on a rank function, call it row Z.

I want to take the symbols in the top row of my workbook and display them as a column on a new sheet, in order of the numeric rank assigned to each symbol.

For example, stock ABC has rank value of 3, XYZ is ranked 1, and AAA is ranked 2. I want the new sheet to display:


XYZ
AAA
ABC

Any idea on how to code this?