there is no custom sort required just select both columns click data click sort then choose sort by column b

http://spreadsheets.about.com/od/oth...4_2003sort.htm