ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorting by more than 3 Fields in VBA (https://www.excelbanter.com/excel-programming/303036-sorting-more-than-3-fields-vba.html)

Kiko

Sorting by more than 3 Fields in VBA
 
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



mark

Sorting by more than 3 Fields in VBA
 
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.

Gary Brown[_7_]

Sorting by more than 3 Fields in VBA
 
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 ). 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


Kiko wrote:
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



Jim Thomlinson[_3_]

Sorting by more than 3 Fields in VBA
 
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...

"unknown" wrote:

Community Message Not Available



All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com