Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
loc loc is offline
external usenet poster
 
Posts: 18
Default Last one for the day! Auto sort.

Can you auto sort a group of cells when a value is changed?
  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 22,906
Default Last one for the day! Auto sort.

Yes.

See this google search result for Formula method or VBA method.

http://snipurl.com/1lkb6


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 09:00:00 -0700, loc wrote:

Can you auto sort a group of cells when a value is changed?


  #3   Report Post  
Posted to microsoft.public.excel.setup
loc loc is offline
external usenet poster
 
Posts: 18
Default Last one for the day! Auto sort.

i bit confused.....i just want it to sort when something is changed...i dont
want to have to hit a alt f8 plus run.....

"Gord Dibben" wrote:

Yes.

See this google search result for Formula method or VBA method.

http://snipurl.com/1lkb6


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 09:00:00 -0700, loc wrote:

Can you auto sort a group of cells when a value is changed?



  #4   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 22,906
Default Last one for the day! Auto sort.

I guess you missed the event code that Sandy posted.

In the sheet module for that sheet, copy and paste this macro:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim EndData As Long
If Target.Column < 2 Then Exit Sub
Application.ScreenUpdating = False
EndData = Cells(Rows.Count, 1).End(xlUp).Row
With Range(Cells(2, 1), Cells(EndData, 2))
.Sort Key1:=Range("B2"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
Application.ScreenUpdating = False
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

The event code operates on column B(2) as written.


Gord


On Tue, 22 May 2007 09:57:01 -0700, loc wrote:

i bit confused.....i just want it to sort when something is changed...i dont
want to have to hit a alt f8 plus run.....

"Gord Dibben" wrote:

Yes.

See this google search result for Formula method or VBA method.

http://snipurl.com/1lkb6


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 09:00:00 -0700, loc wrote:

Can you auto sort a group of cells when a value is changed?




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
Is there a way to Auto sort or save a sort? Barbie Excel Discussion (Misc queries) 11 December 1st 09 09:48 PM
auto sort Mike Excel Discussion (Misc queries) 3 June 26th 06 04:14 PM
Auto sort A Excel Worksheet Functions 1 March 29th 06 11:13 PM
Auto Sort ??? goodpasture Excel Discussion (Misc queries) 0 May 31st 05 08:24 PM
auto sort? Dave Excel Discussion (Misc queries) 10 April 5th 05 12:33 PM


All times are GMT +1. The time now is 09:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"