Macro Sort

  • Thread starter Thread starter Scottmk
  • Start date Start date
S

Scottmk

I've got three columns of data :
Name Ticker Score

I wish to sort by score; having the names and ticker adjust to the
change. I would like to do this with a macro button on another page.
When the button is clicked, I would like to arrive at the already
sorted data.

Much obliged ... You all are great
 
I beleive this will solve your problem.
Use the following code, adjusting of course for the proper
placement of your column header lables. I have assumed
there is no data beneath the data you are sorting. If this
is not tru you will want to change the "Cells(Rows.Count,
3).End(xlUp)" to "Cells(1,3).End(x1Down)". Then just have
your button click event call the Sort1 subroutine.

Sub Sort1()
'
Worksheets(Ticker_Sheet).Activate
'This assumes that column A(1 using Cells reference) is
name and C(3 in Cells reference) is Score
Range(Cells(1, 1), Cells(Rows.Count, 3).End
(xlUp)).Select
Selection.Sort Key1:=Range("C1"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Range("A1").Select
End Sub

Good Luck
Mic
 
Back
Top