Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need a macro to run sort automatically

Need a macro to run sort automatically
I need a macro to select the data till the last line and sort the data.
Attaching a sample file.
Hope someone help me
Thanks in advance
GT

Attachment filename: sort.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=400634
---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Need a macro to run sort automatically

I don't open attachments but here is sample code for one method -

Sub SortNewList()
Range("A5").Select 'select a cell within the list.
Selection.CurrentRegion.Select 'selects everything adjoining that cell.
Selection.Sort Key1:=Range("F5"), Order1:=xlAscending, Key2:=Range("D5") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
_
False, Orientation:=xlTopToBottom 'Change criteria to fit your
list needs.
Range("A1").Select 'Begining of sheet.
End Sub

"gmangad " wrote in message
...
Need a macro to run sort automatically
I need a macro to select the data till the last line and sort the data.
Attaching a sample file.
Hope someone help me
Thanks in advance
GT

Attachment filename: sort.xls
Download attachment:

http://www.excelforum.com/attachment.php?postid=400634
---
Message posted from http://www.ExcelForum.com/



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
Sort automatically MAX Excel Worksheet Functions 2 March 17th 09 02:28 PM
Macro to Sort automatically when file/save is selected KDG Excel Discussion (Misc queries) 3 December 20th 05 08:28 PM
Automatically Sort Tables tamato43 Excel Discussion (Misc queries) 2 March 22nd 05 07:59 PM
sort automatically Mike Lemke Excel Worksheet Functions 2 October 31st 04 08:18 PM
Macro to Sort Automatically Based on Contents of Drop-down Box Ashleigh K. Excel Programming 1 August 25th 03 10:05 PM


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