So you're saying that if you select a cell, the data will be re-sorted with the column of the active cell being the primary (or only?) sort field?
should be simple enough using a selection_change event. use target.column to get the column number for the sort. you would also want to check to see that the target.count = 1 (in case multiple cells are selected) Are you familiar enough with VBA to do this? or do you need more assistance? Paul ----- Original Message ---- > From: Tom <tcli...@gmail.com> > To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> > Sent: Fri, November 5, 2010 8:38:06 AM > Subject: $$Excel-Macros$$ How to sort database > > My dataset occupies 50 rows by 20 columns which I defined as my > "database". > There is no difficulty if I choose to sort the "database" either by a > known column or row. > But what I really want the program to do is to sort it by column > wherever the active cell > happens to be - whose location is unknown. Can anyone figure out how > this could > be done? > > TIA, > Tom > > -- >---------------------------------------------------------------------------------- >- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : >http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts > -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts