Macros to sort data with respect to the colum

Solved/Closed
Test - Feb 5, 2010 at 12:39 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 5, 2010 at 04:50 AM
Hello,

I am facing a problem in sorting the data w.r.t to column header. I have 25 columns in which i need to sort the sata w.r.t to two of the columns. When i tried this with macros i found that the data is sorted along with column header as well and i am struck here without any clue.

Could any one of you help me out to overcome this issue.

Thanks in Advance.
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 5, 2010 at 04:50 AM
you need to start from sort from row 2 and tell that there is a header

Selection.Sort _
Key1:=Range("A2"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
8