Sorting Columns

L

Leslie Barberie

I have three columns

Store City Date
Penneys Dallas 4/5/02
Sears Atlanta 6/7/01
Macys Miami 10/15/02
Nordstrom Baltimore 9/28/01

I have three worksheets. Each has the same data. I want sheet 1 to sort ascending by store, sheet 2 to sort ascending by city, sheet to sort ascending by date. I want these sorts to occur whan the sheet is activated. Can you help me, please?

I have Windows XP, Office 2003.

Leslie Barberie
 
M

mzehr

Go to Sheet 1, right click on the tab, select View Code
and past the following
Sub Worksheet_Activate()

Sheets("Sheet1").Select
Columns("A:C").Select
Selection.sort Key1:=Range("A2"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
End Sub

Do the same on worksheet 2 and 3, changing the Range("A2")
to the appropriate column for your sort

HTH
-----Original Message-----
I have three columns

Store City Date
Penneys Dallas 4/5/02
Sears Atlanta 6/7/01
Macys Miami 10/15/02
Nordstrom Baltimore 9/28/01

I have three worksheets. Each has the same data. I want
sheet 1 to sort ascending by store, sheet 2 to sort
ascending by city, sheet to sort ascending by date. I
want these sorts to occur whan the sheet is activated.
Can you help me, please?
 
Top