Basic Sorting query

  • Thread starter Thread starter thebottomline
  • Start date Start date
T

thebottomline

Hi, I'm very new to Microsoft Excel, and all I know is primarily sel
taught, as in my course we focussed on the use of Microsoft Acces
instead. Anyway, my query is as follows:

I've made a spreadsheet for the football world cup. I have one shee
with the fixtures in, and one with the groups that take data from th
fixtures to make the group tables. My problem with the sorting is a
follows:

Because of the way the groups are done, I've got them sorted firstly b
points descendingly, secondly by goal difference, then thirdy by goal
scored. When I enter results for the fixtures in the first sheet, i
updates the table for results and points, but doesn't update th
sorting. I have to go Data - > Sort and press OK again for it to Sor
again.

Is there any way to update Sort automatically?

Thanks for any help
 
i'd link this to button, so that after you have enterred all your
scores you can update

Sub Reordertables()
Sheets("Sheet2").Activate
Selection.Sort Key1:=Range("G2"), Order1:=xlDescending,
Key2:=Range("F2") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase:= _
False, Orientation:=xlTopToBottom
End Sub

I assume you have more than one table though.
I'd say record a macro while you perform the task and see what code is
generated.

somethinglikeant
 
I would suggest using the record macro function to record the manual
sorting operation and then copy the code into the worksheet_activate
event macro for the second sheet.

This way, every time you switch to the second sheet, a sort will be
done automatically.
 
Cheers mrice, that sounds the best way to do it, everytime i go onto th
sheet it happens. how would i go about doing that
 
Use macro-record macro on the tools menu.

Then paste into the sheet1 tab where you have selected worksheet an
activate in the boxes at the top
 
Back
Top