Macros to sort data with respect to the colum [Solved/Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
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.

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
761
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
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!