Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Code for auto league tables!

Hi...

I have 3 columns A - C.

In Column A I have values 1 -15 in descending order.
In Column B I have names of tools.
In Column C I have values that are subject to change.

What I need is some code that will look at the values column C and then
shift the tool names in Column B so that it creates a league table. Column A
can remain unchanged. This all needs to be intuitive and automated so that
there is no user control.

Thanks

GC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Code for auto league tables!

Gordon wrote:
Hi...

I have 3 columns A - C.

In Column A I have values 1 -15 in descending order.
In Column B I have names of tools.
In Column C I have values that are subject to change.

What I need is some code that will look at the values column C and then
shift the tool names in Column B so that it creates a league table. Column A
can remain unchanged. This all needs to be intuitive and automated so that
there is no user control.

Thanks

GC


Hi Gordon,

If the tool with the highest Column C value goes to the top of the
league table then you could try...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C2:C16")) Is Nothing Then
Application.EnableEvents = False
On Error GoTo ERROR_HANDLER
Range("B2:C16").Sort Key1:=Range("C2"), _
Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.EnableEvents = True
End If
Exit Sub
ERROR_HANDLER: Application.EnableEvents = True
End Sub

If the tool with the lowest Column C value goes to the top of the
league table then you could try...


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C2:C16")) Is Nothing Then
Application.EnableEvents = False
On Error GoTo ERROR_HANDLER
Range("B2:C16").Sort Key1:=Range("C2"), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.EnableEvents = True
End If
Exit Sub
ERROR_HANDLER: Application.EnableEvents = True
End Sub

Choose the appropriate code, copy it, right click the sheet tab, select
"View Code", paste the code, press Alt + F11 to get back to Excel.

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Code for auto league tables!

E2: =INDEX($B$2:$B$16,MATCH(SMALL(C$2:C$16,ROWS($1:1)) ,$C$2:$C$16,0))

copy down

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Gordon" wrote in message
...
Hi...

I have 3 columns A - C.

In Column A I have values 1 -15 in descending order.
In Column B I have names of tools.
In Column C I have values that are subject to change.

What I need is some code that will look at the values column C and then
shift the tool names in Column B so that it creates a league table. Column
A
can remain unchanged. This all needs to be intuitive and automated so that
there is no user control.

Thanks

GC



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
Creating Football League Tables Andy New Users to Excel 1 August 19th 07 12:47 PM
League Tables Howard Excel Worksheet Functions 0 September 6th 05 11:56 AM
League Tables for sports events mje26811 Excel Discussion (Misc queries) 1 March 17th 05 12:01 PM
Creating League tables House Excel Worksheet Functions 0 March 15th 05 09:21 AM
auto pivot tables and charts ? scottwilsonx[_47_] Excel Programming 0 September 29th 04 12:53 PM


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

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"