Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I try to sort a worksheet range with 3 criterias as allowed by Sort method programmed in Javascript. The problem is that the sort is performed on the first and third criteria but not performed on the second criteria. As I read on an older post, there is the same problem with Vbscript as the second criteria is not taken into account when there are 3 criterias. My simplified code is : excelapp = new ActiveXObject("Excel.Application"); excelapp.workbooks.open (myfile.xls); excelapp.activeworkbook.worksheets(mysheetname).se lect(); xl=excelapp.activesheet; myrange.sort(xl.columns(1),1,xl.columns(2),null,1, xl.columns(3),1,1,1,0,1); Referring to the short Sort method arguments list : expression.Sort(Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation, SortMethod) it seems that the Type argument is not well passed to Excel, since the following code is effective : myrange.sort(xl.columns(1),1,xl.columns(2)); As soon the Type argument is listed, the second column is not sorted. Could someone knows how to pass the Type argument? The null and "" values are the only values accepted in my tests. An empty value (as in VBscript) is not accepted. Thank you for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort method | Excel Programming | |||
Sort Method more than 3 cols | Excel Programming | |||
Using the Sort Method | Excel Programming | |||
Sort Method | Excel Programming | |||
Sort Method Questions | Excel Programming |