Hi
I have a league table (attachment table named 'World Cup League'). It
updates scores as i enter them into a data table that precedes it
(titled 'Games Won'). I would like to be able to automatically sort
the 'World Cup League' in descending order every time i enter data into
the 'Games Won' table to save me having to sort it every time. Any
ideas would be gratefully received as i am trying to run a competition
as a charity event and need to have to do as little possible to save
time. Thank you -------------------------------------------------------------------
|Filename: World Cup.zip |
|Download: www.excelforum.com/attachment.php?postid=4776 |
-------------------------------------------------------------------
--
Blade2304
------------------------------------------------------------------------
Blade2304's Profile: www.excelforum.com/member.php...oamp;userid=33492
View this thread: www.excelforum.com/showthread...hreadid=543078You can do it everytime you open the workbook.
Private Sub Workbook_Open()
'your code here
End Sub
Thats all I know.
Gary
quot;Blade2304quot; gt; wrote
in message ...
gt;
gt; Hi
gt;
gt; I have a league table (attachment table named 'World Cup League'). It
gt; updates scores as i enter them into a data table that precedes it
gt; (titled 'Games Won'). I would like to be able to automatically sort
gt; the 'World Cup League' in descending order every time i enter data into
gt; the 'Games Won' table to save me having to sort it every time. Any
gt; ideas would be gratefully received as i am trying to run a competition
gt; as a charity event and need to have to do as little possible to save
gt; time. Thank you
gt;
gt;
gt; -------------------------------------------------------------------
gt; |Filename: World Cup.zip |
gt; |Download: www.excelforum.com/attachment.php?postid=4776 |
gt; -------------------------------------------------------------------
gt;
gt; --
gt; Blade2304
gt; ------------------------------------------------------------------------
gt; Blade2304's Profile:
gt; www.excelforum.com/member.php...oamp;userid=33492
gt; View this thread: www.excelforum.com/showthread...hreadid=543078
gt;
For Excel to quot;automaticallyquot; do anything (such as sort), there must be
something to trigger Excel to sort. This can be something like entering
anything in a cell in Column whatever, or Row whatever, or in a specific
cell. You said quot;every time I enter data into the 'Games Won' tablequot;. Do
you mean whenever you enter anything in any cell in the entire table? Or
maybe you mean whenever you fill in a row. In that case Excel can be setup
to sort when you enter something in the last cell of a row. In other words,
when you enter anything into any cell in that column.
Or perhaps you would like to have just a button somewhere in the sheet,
usually at the top, that you can click on to trigger the sort. Post back
and clarify what you have and what you want. HTH Otto
quot;Blade2304quot; gt; wrote
in message ...
gt;
gt; Hi
gt;
gt; I have a league table (attachment table named 'World Cup League'). It
gt; updates scores as i enter them into a data table that precedes it
gt; (titled 'Games Won'). I would like to be able to automatically sort
gt; the 'World Cup League' in descending order every time i enter data into
gt; the 'Games Won' table to save me having to sort it every time. Any
gt; ideas would be gratefully received as i am trying to run a competition
gt; as a charity event and need to have to do as little possible to save
gt; time. Thank you
gt;
gt;
gt; -------------------------------------------------------------------
gt; |Filename: World Cup.zip |
gt; |Download: www.excelforum.com/attachment.php?postid=4776 |
gt; -------------------------------------------------------------------
gt;
gt; --
gt; Blade2304
gt; ------------------------------------------------------------------------
gt; Blade2304's Profile:
gt; www.excelforum.com/member.php...oamp;userid=33492
gt; View this thread: www.excelforum.com/showthread...hreadid=543078
gt;
Whenever i enter something into the 'Games Won' table. By entering a
number into this table in any cell totals change. These totals then
transfer into the 'World Cup League' table and therefore the
competitors need sorting into rank order with most points first. I
know i could do this with manually sorting each time i enter new data
but it would be nice if it did it automatically. Also there may be
blank rows in this table so i dont want them to be included in this
sort.--
Blade2304
------------------------------------------------------------------------
Blade2304's Profile: www.excelforum.com/member.php...oamp;userid=33492
View this thread: www.excelforum.com/showthread...hreadid=543078Blade
This macro does what you want. I assumed the following:
Both the Games Won and World Cup League tables are on the same sheet.
The range of the Games Won table is named GamesWon.
The range of the World Cup League table is named WorldCupLeague.
The World Cup League table has its headers in Row 1 and the Rank Order
column is Column H.
Note that this is a sheet event macro and must be placed in the sheet module
of the sheet that holds the two tables. To access that module, right-click
on the sheet tab of that sheet, select View Code and paste this macro into
that module. Click on the quot;Xquot; in the top right corner to return to the
sheet. Post back if you need help with changing this macro to work with
your data layout. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = quot;quot; Then Exit Sub
If Not Intersect(Target, Range(quot;GamesWonquot;)) Is Nothing Then _
Range(quot;WorldCupLeaguequot;).Sort Key1:=Range(quot;H2quot;), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
quot;Blade2304quot; gt; wrote
in message ...
gt;
gt; Whenever i enter something into the 'Games Won' table. By entering a
gt; number into this table in any cell totals change. These totals then
gt; transfer into the 'World Cup League' table and therefore the
gt; competitors need sorting into rank order with most points first. I
gt; know i could do this with manually sorting each time i enter new data
gt; but it would be nice if it did it automatically. Also there may be
gt; blank rows in this table so i dont want them to be included in this
gt; sort.
gt;
gt;
gt; --
gt; Blade2304
gt; ------------------------------------------------------------------------
gt; Blade2304's Profile:
gt; www.excelforum.com/member.php...oamp;userid=33492
gt; View this thread: www.excelforum.com/showthread...hreadid=543078
gt;
- Sep 10 Mon 2007 20:39
Automatic League Sort
close
全站熱搜
留言列表
發表留言