ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Basic Sorting query (https://www.excelbanter.com/excel-discussion-misc-queries/93319-basic-sorting-query.html)

thebottomline

Basic Sorting query
 

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

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

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

Is there any way to update Sort automatically?

Thanks for any help.


--
thebottomline
------------------------------------------------------------------------
thebottomline's Profile: http://www.excelforum.com/member.php...o&userid=35290
View this thread: http://www.excelforum.com/showthread...hreadid=550780


somethinglikeant

Basic Sorting query
 
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


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

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

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

Is there any way to update Sort automatically?

Thanks for any help.


--
thebottomline
------------------------------------------------------------------------
thebottomline's Profile: http://www.excelforum.com/member.php...o&userid=35290
View this thread: http://www.excelforum.com/showthread...hreadid=550780



mrice

Basic Sorting query
 

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.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=550780


thebottomline

Basic Sorting query
 

Cheers mrice, that sounds the best way to do it, everytime i go onto the
sheet it happens. how would i go about doing that?


--
thebottomline
------------------------------------------------------------------------
thebottomline's Profile: http://www.excelforum.com/member.php...o&userid=35290
View this thread: http://www.excelforum.com/showthread...hreadid=550780


mrice

Basic Sorting query
 

Use macro-record macro on the tools menu.

Then paste into the sheet1 tab where you have selected worksheet and
activate in the boxes at the top.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=550780



All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com