This tutorial demonstrates how to add an "Indent Text" menu item to a Google spreadsheet so you can indent/outdent text.
-
When the "Indent Text" menu item is selected, any cells within a single column selection will be indented by 5 spaces.
-
You can increase or decrease the number of spaces the text is indented by changing the line below so that the "5" is changed to a larger or smaller number (depending on your preference):
newValues.push(['=CONCAT(REPT( CHAR( 160 ), 5),"' + values[i][0] + '")']);
- This code works on multiple cells so you can select an entire column and indent in bulk.
Great job! Thank you so much for sharing.
@CShaded, I also had this problem with quotation marks. It happens because they conflict with the ones used as string delimiters in the formula. I managed to solve this issue by replacing any occurrence of
"
with""
. It tells Google Sheets to consider it part of the value, instead of a string delimiter.You can do this by changing the line
to:
It worked in my case (I didn't test it against other situations, though).