ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto sorting (https://www.excelbanter.com/excel-programming/290624-auto-sorting.html)

Ed[_16_]

auto sorting
 
Suppose I have one view of the data with the following columns:

NAME | YEARS OF SERVICE | SALARY | DEPARTMENT

I have this data in "Worksheet 1" sorted by Name, is there a way to
automatically generate other views of this data where each worksheet has
these data sorted by different columns (e.g. by YEARS OF SERVICE, by SALARY,
by DEPARTMENT)?

Thanks.



Tom Ogilvy

auto sorting
 
Possibly using a pivot table you can get what you want.

--
Regards,
Tom Ogilvy


Ed wrote in message
...
Suppose I have one view of the data with the following columns:

NAME | YEARS OF SERVICE | SALARY | DEPARTMENT

I have this data in "Worksheet 1" sorted by Name, is there a way to
automatically generate other views of this data where each worksheet has
these data sorted by different columns (e.g. by YEARS OF SERVICE, by

SALARY,
by DEPARTMENT)?

Thanks.





Gord Dibben

auto sorting
 
Ed

If you truly want 3 new worksheets with differing sorted views.

Using macro recorder produced this............

Range("A1").Select
Range("A:D").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Sheets("Sheet6").Copy Befo=Sheets(1)
Range("A:D").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Sheets("Sheet6").Copy Befo=Sheets(1)
Range("A:D").Sort Key1:=Range("C2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Sheets("Sheet6").Copy Befo=Sheets(1)
Range("A:D").Sort Key1:=Range("D2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Gord Dibben Excel MVP

On Sat, 7 Feb 2004 18:51:58 -0500, "Ed" wrote:

Suppose I have one view of the data with the following columns:

NAME | YEARS OF SERVICE | SALARY | DEPARTMENT

I have this data in "Worksheet 1" sorted by Name, is there a way to
automatically generate other views of this data where each worksheet has
these data sorted by different columns (e.g. by YEARS OF SERVICE, by SALARY,
by DEPARTMENT)?

Thanks.




All times are GMT +1. The time now is 11:18 AM.

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