how do i keep sort settings?

  • Thread starter Thread starter MsMcGyver
  • Start date Start date
M

MsMcGyver

I have a spreadsheet that is not really used as one. It is a tally of 120
different categories so with in the spread sheet I am sorting by number of
votes say column b and then add field and the balance of a gets sorted
alphabetically. the sort box cles each section and i have to re set the
settings. can i keep it open and default the settings for this project? I am
new to 2007 excel
Thanks
 
I would setup a Custom ToolBar Button and assign this macro to it. This way
whenever you click this button it will sort the columns specified. Note:
The code below sorts Columns A then B then C, you will have to change it to
accomendate your application.

Hope this helps!
 
Oops! This is better. I assume you have a header row, if not, just delete
the Header portion of the code


Sub SortData()

ActiveSheet.UsedRange.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("B2"), Order2:=xlAscending, _
Key3:=Range("C2"), Order3:=xlAscending, _
Header:=xlYes

End Sub
 
Back
Top