sort question

Hi
Is it possible to sort farther back than key3 to break ties. excel won’t take a key4.
heres my script

tell application "Microsoft Excel"
	activate
	accept all changes active workbook
	
	set columnToTest to last column of used range of active sheet
		set cellCount to count of cells of columnToTest
	set usedRanges to used range of worksheet object of columnToTest
	set rowsCount to first row index of (get end cell cellCount of columnToTest direction toward the bottom)
	set lastCol to (first column index of usedRanges) + (count of columns of usedRanges)
	set formulaCells to get resize (cell 1 of column (lastCol) of active sheet) row size rowsCount
	set formula r1c1 of formulaCells to ¬
		"=SUM(RC[-5]:RC[-1])"
	set sort1 to (count of columns of usedRanges)
	set sort2 to (count of columns of usedRanges) - 1
	set sort3 to (count of columns of usedRanges) - 2
	
	set sortRange1 to get address cell 1 of column (sort1) of active sheet
	set sortRange2 to get address cell 1 of column (sort2) of active sheet
	set sortRange3 to get address cell 1 of column (sort3) of active sheet
	
	sort range sortRange1 of worksheet "Sheet1" key1 (range sortRange1 of worksheet "Sheet1") order1 sort descending key2 (range sortRange2 of worksheet "Sheet1") order2 sort descending key3 (range sortRange3 of worksheet "Sheet1") order3 sort descending
	
end tell

here is a small part of worksheet
1 0 1 0 1 1 1 0
2 1 0 0 0 0 1 1
3 0 0 0 1 1 1 1
4 0 0 1 0 0 0 1
5 0 0 1 0 0 1 0
6 0 0 1 0 1 0 0
7 0 1 0 0 0 0 0
8 0 0 0 0 0 0 0
9 0 0 0 1 1 1 0
10 0 0 0 1 0 0 0
thanks
bills

I’m not sure for Excel2008, but other than that no, you can’t sort more than 3 levels deep on one go.
The usual workaround is to sort your data by 4th column,
then do sort the rusult of that by the 1st, 2nd, 3rd columns.

Hi
Thanks mikerickson, that does exactly what I want. I do appreciate the help your giving me.