Uh, no. You want to sort on X. Y is kinda 'attached' to X. As branches on a tree. Why i visualise an array as a tree. Sorting on the Y will indeed rearrange the whole tree, forgetting the branches.
I would Use an temp array. (in dont know better)
For the first number (150 in '150, cell01, cell02, cell03, cell04, cell05') you can just sort on the X-axis.
Then you got to loop each Y on an each X index, copy the values on that Y index to an X-axis in a temp array.
Sort that array, and copy them back.
So copy 'cell01, cell02, cell03, cell04, cell05' to a temp array. Sort the Temp on X. Copy the sorted values back.
If you need an example, give me an array in a .capx. Will do.