'(1) How to retain row heights even after sorting column. (2) Print two columns from a single column

Google sheet Link:

enter image description here

I want to achieve 2 things:

  1. Sort Quality in A to Z order with same size of images, But when I Sort the image's size changes because sorting does not retain row heights as shown below:
    enter image description here

  2. I want to print the sheet with 2 columns in a single page to utilize maximum space like this: This_word_file enter image description here
    which I have done it many times within seconds by simply copying the sheet column to MS Word & changing word layout to two columns BUT now suddenly (last successful copy and paste was in September 2021) when I paste the columns in word the images are getting cropped like: this_word_file enter image description here

I am not looking for the final file, I want to learn the process to achieve these both.

Thank You



Solution 1:[1]

For adjusting the size of your cell to a certain size, as refereed in the comments, you can use setRowHeightsForced(startRow, numRows, height).

First, if you are not familiar with Google Apps Script, you can follow up with this guides.

After getting familiar with Google Apps Script, you can follow these steps:

  1. In your script go to Extension > Apps Script
  2. In your Code.gs file, copy this code:

Your question is too broad, please keep in mind this guide in order to ask questions.

const setFixedHeigth = () => {
  const ss = SpreadsheetApp.getActiveSpreadsheet()
  const sheet = ss.getSheets()[0]
  const range = sheet.getRange('D:D').getValues()
  for (let i = 0; i <= range.length; i++) {
    /* Check that the content is an image */
    if (range[i][0].valueType !== SpreadsheetApp.ValueType.IMAGE) return
    /* Change the rowHeigth to 200px */
    sheet.setRowHeightsForced(i + 1, 1, 200)
  }
}

This script will check all the D cells looking for an IMAGE, when found one, will change his size to 200px.

Documentation

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Emel