Sorting Columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 

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

Similar Threads

Sorting Date Column 1
sort date 2
sort dates 2
macro criteria copy 9
A Sorting Dilemna 1
Sort all cells except one? 1
Sort multiple columns on all worksheets 2
sorting dates in a worksheet 3

Back
Top