I fixed some of the coding here to try and make it a little more efficient - and work.

Sorting appears to work now, and I also added an Alignment selection for each column (left, center, right).
See how it runs on 2007 - this was created in Excel 2002 so I'm not sure if there are some inconsistencies with the formulas or macros. On 2002, there's no way around copying the full 50 rows to get the table code properly saved in the clipboard.
Have a try...