Sorting by more than 3 Fields in VBA

  • Thread starter Thread starter Kiko
  • Start date Start date
K

Kiko

Is it possible to sort a Spreadsheet in Excel using VBA by more than 3
fields (which is the limit of the Excel functionality)?
Thanks
 
Is it possible to sort a Spreadsheet in Excel using VBA
by more than 3 fields (which is the limit of the Excel
functionality)?

You would need to do it the same as you would in Excel.

Sort by the lower level sorts, and then resort by the
higher level sorts.

In the Help:

Search on 'Sort'
Select 'Sort rows based on the contents of two or more
columns'
Steps 3 and 4 explain how to sort with more than three
sort levels.
 
Hi Kiko. I was searching Google concerning sorting and saw your
posting. I have created a form that allows you to sort by any/all
available columns, ascending or descending, allows you to change the
range, etc.. If you'd like a copy, just send me an email to my home
address ([email protected]). I'll send you a zip file. I wrote
this a couple of nights ago so there may be bugs but, I'll tell you,
I've already found it invaluable (I'm an Accountant and manipulate a
LOT of data).
CYA...There is no warranty explicit or implied by this offer.
Don't know if you still need this as your posting was in July'04 and
it's already December.
Sincerely,
Gary Brown
 
Excel has a limit of 3 fields for any one sort operation. You can get around
this by doing a reverse sort. That is if you want to sort by Columns (in
order) A B C D then simple do individual sorts in the order D C B A. In this
way you will have sorted all 4 columns correctly.

Hope this helps...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top