Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 -- thanks Mike |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 "Mike" wrote: 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 -- thanks Mike |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() http://cjoint.com/?gzpLgKMXQY Auto Sort Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 And Target.Count = 1 Then Range("A2", [B65000]).Sort key1:=[A2] End If End Sub Cordialy JB Mike a écrit : 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 -- thanks Mike |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 -- thanks "Toppers" wrote: 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 "Mike" wrote: 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 -- thanks Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic column chart - auto sort on data range | Charts and Charting in Excel | |||
Auto sort & save | Excel Worksheet Functions | |||
Auto Sort using Macro | Excel Worksheet Functions | |||
Excel Auto Filter: WHY'S SORT @ TOP OF LIST? WHEN I KEY TO "SHOW . | Excel Worksheet Functions | |||
Auto Sort | Excel Worksheet Functions |