Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Hi,
I compile a lot of tables for chess tournaments and am wondering if anyone
can help with the following -

The tables are updated after each result is received, the tables are then
posted to the web. At present the table rows are left 'as is' with the 1st
ranked player being highlighted.

I would like to order the table so that the rows are ranked by order of
total points. The row would then have to be assembled so that the match
pairings remained intact. Can anyone hep point me in the right direction to
write a macro to achieve this sorting please? A sample file can be seen at
http://www.bfcc-online.org.uk/Britis...3/cane2003.htm

Best Wishes,
Mickey


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Apologies, the link I gave is the one table with no results as yet! Please
try this one -
http://www.bfcc-online.org.uk/Britis...3/cane2003.htm

I need to keep the black squares all in a neat diagonal for the table once
sorting is complete.

Mickey


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Damm, I am asleep today! The link is -
http://www.bfcc-online.org.uk/Britis...3/cand2003.htm


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sort columns by Rank

Hi Mickey,

Here's a macro

Sub SortResults()

Range("N7").EntireColumn.Insert
Range("O8:O14").Copy
Range("N8").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
Range("A7:O14").Sort Key1:=Range("N8"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
Range("N7").EntireColumn.Delete
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mickey" wrote in message
...
Hi,
I compile a lot of tables for chess tournaments and am wondering if anyone
can help with the following -

The tables are updated after each result is received, the tables are then
posted to the web. At present the table rows are left 'as is' with the

1st
ranked player being highlighted.

I would like to order the table so that the rows are ranked by order of
total points. The row would then have to be assembled so that the match
pairings remained intact. Can anyone hep point me in the right direction

to
write a macro to achieve this sorting please? A sample file can be seen

at
http://www.bfcc-online.org.uk/Britis...3/cane2003.htm

Best Wishes,
Mickey




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Hi Bob,
Poole Harbour is beautiful, I always enjoyed my trips that way.

Thanks for the macro but unfortunately it doesn't appear to work. It does
sort the table but messes up the order of columns, hence player 2 who had
drawn with say player 5, is then shown as no result against the same player.
The points do not get ranked in order although most appear to be correct,
however the highest points end up at the bottom?

Perhaps sorting the table as desiredis not feasible?

Mickey




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sort columns by Rank

Mickey,

Actually the problem is with your formulae in the lower half of the table.
You need to convert them all to absolute references to make it okay. So for
instance the formula in F9
=IF(G24=1,0,IF(G24=0.5,0.5,IF(G24=0,1,"")))
should read
=IF($G$24=1,0,IF($G$24=0.5,0.5,IF($G$24=0,1,"")))

If you want to select all the cells and then run this code, it will convert
them all for you

Dim cell
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, xlA1,
xlA1, xlAbsolute)
End If
Next cell

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mickey" wrote in message
...
Hi Bob,
Poole Harbour is beautiful, I always enjoyed my trips that way.

Thanks for the macro but unfortunately it doesn't appear to work. It does
sort the table but messes up the order of columns, hence player 2 who had
drawn with say player 5, is then shown as no result against the same

player.
The points do not get ranked in order although most appear to be correct,
however the highest points end up at the bottom?

Perhaps sorting the table as desiredis not feasible?

Mickey




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Hi Bob,
Thanks again, I tried to run the absolute ref code but got a syntax error
from the line cell.Formula = Application.ConvertFormula(cell.Formula,
xlA1,
xlA1, xlAbsolute)

I will convert the formulae by hand and try the code again, I am sure it
will work. A massive thanks for your help, this could save me many hours of
work.

Mickey


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sort columns by Rank

Hi Bob,
I got the '$' entered manually, unfortunately the table still did not sort
correctly. The higher figures ended at the bottom and the columns were out
of sync.

Thanks for your help on this cold Sunday.
Mickey


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort rank Jennifer Excel Worksheet Functions 3 September 29th 09 04:16 PM
Rank and Sort Basenji Excel Worksheet Functions 15 September 3rd 09 04:08 AM
Rank and Sort watermt Excel Worksheet Functions 2 May 20th 09 02:43 PM
Rank then sort then pastelink SueQueen Excel Worksheet Functions 4 September 15th 08 05:26 AM
Microsoft Excel Rank and Sort [email protected] Excel Discussion (Misc queries) 2 July 7th 07 04:14 AM


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"