#1   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default auto sort

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   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default auto sort

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   Report Post  
Posted to microsoft.public.excel.misc
JB
 
Posts: n/a
Default auto sort


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   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default auto sort

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
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
Dynamic column chart - auto sort on data range jimfrog Charts and Charting in Excel 0 March 29th 06 02:45 PM
Auto sort & save Pebbbles Excel Worksheet Functions 0 February 14th 06 03:26 AM
Auto Sort using Macro Rubix Excel Worksheet Functions 3 November 13th 05 09:24 AM
Excel Auto Filter: WHY'S SORT @ TOP OF LIST? WHEN I KEY TO "SHOW . Dan W Excel Worksheet Functions 0 December 1st 04 03:53 PM
Auto Sort Phil Excel Worksheet Functions 1 November 24th 04 11:13 AM


All times are GMT +1. The time now is 02:54 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"