auto sort

M

Mike

Hi i have a league set up and want to auto sort it as i add the scores, it is
in A2:F9, and i want to sort B3:F9, is there a macro that will do this for
me please
 
T

Toppers

Mike,
Record a macro do the sort, name it (for example) "SortTable"
and then insert the code below into the sheet containing your table by
clicking on the sheet tab==>view code and copy and paste.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isectrng As Range

On Error GoTo Wsexit
Application.EnableEvents = False
Application.ScreenUpdating = False

Set isectrng = Range("L:L,N:N") ' <== change to relect range in which scores
are placed

Set isect = Application.Intersect(Target, isectrng)
If Not isect Is Nothing Then
SortTable '<== change to your macro name as required
End If

Wsexit:
Application.EnableEvents = True
End Sub

HTH
 
M

Mike

Hi that works great thanks, except it only works if i enter the changes
directly into the league, but the scores are entered on a different sheet
which puts the req wins into the league, it doesnt auto sort that way, any
ides please
 
Top