I'm working on a sheet that involves multiple columns corresponding to various data. Each column has a varying number of cells of varying heights with wrapped text. What I want to do is make the sheet as compact as possible, such that a cell in column A that is 50px high is in the same row as other cells with that height (or as close to that height as possible). Essentially, I want to make the output of
Logger.log(sheet.getRowHeight()) result in each column sorting by height, ascending. I've been doing this by hand so far—when a cell in a column has a height of, say, 100px I move it to the row that has cells in other columns close to that height (with the smallest cells at the top).
I don't know Google sheets syntax really at all; I know basically what I want to do, but I have no idea how to implement it with the commands available. If there is a way to get the cell with the most height in each column to be moved to row 2 (I have a header row), second-most height to row 3, etc. that would be great. Even better would be if I could somehow sort a column with only three cells whose tallest cell is like 200px such that that cell is moved down to a row of similar height even if that results in several empty cells above it.