ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need a macro to run sort automatically (https://www.excelbanter.com/excel-programming/287186-need-macro-run-sort-automatically.html)

gmangad[_3_]

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/


Mike Fogleman

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/





All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com