Micro Focus QTP (UFT) Forums
Custom sort -Excel Sheet - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Custom sort -Excel Sheet (/Thread-Custom-sort-Excel-Sheet)



Custom sort -Excel Sheet - kiran - 01-27-2014

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


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


RE: Custom sort -Excel Sheet - supputuri - 01-28-2014

Check this
Excel Sort