01-27-2014, 09:14 PM
I want to apply custom sort on option for more than 4 levels , currently i am able to apply only on till three levels i.e as follows using following
But using above code i am able to apply code only till three levels.I want to known how to apply sort on excels sheet for more than 3 levels .
Thanks
KK
Code:
Set objWorkbook = objExcel.Workbooks.Open("C:\EXCEL.xls")
Set objWorksheet = objWorkbook.Worksheets(1)
Set objRange = objWorksheet.UsedRange
Set objRange2 = objExcel.Range("A1")
Set objRange3 = objExcel.Range("B1")
Set objRange4 = objExcel.Range("C1")
Set objRange5 = objExcel.Range("D1")
objRange.Sort objRange2,xlDescending,objRange3, ,xlAscending,objRange4,xlDescending,xlYes
But using above code i am able to apply code only till three levels.I want to known how to apply sort on excels sheet for more than 3 levels .
Thanks
KK