Friday, September 28, 2012

yogi_Sort Data Of A Specified Column Only Given A Table (Using Sort Command And Alternately Sort Function)

Yogi Anand, D.Eng, P.E.      Google Spreadsheet   Post  #782  Sep 28, 2012

user GiveDark said: (!category-topic/docs/spreadsheets/5-A4_I3thYI
Script to sort certain columns in spreadsheet 
I want to write a script that will sort part of a spreadsheet by one column, but keep the rest of the spreadsheet unsorted.  The column that I am sorting by (say column B) is always the same.  I a couple other columns to follow the sorting of column B (so that the rows stay together).  So far this is the equivalent of -> Data -> Sort Sheet by Column B.  However, I do not want the rest of the columns to be sorted.  They should stay exactly the same.

Does anyone have any hints on how to write a script for this?  Even tips on doing part of this would be helpful, such as how to select only certain columns.


see the following illustration