Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort rank | Excel Worksheet Functions | |||
Rank and Sort | Excel Worksheet Functions | |||
Rank and Sort | Excel Worksheet Functions | |||
Rank then sort then pastelink | Excel Worksheet Functions | |||
Microsoft Excel Rank and Sort | Excel Discussion (Misc queries) |