forcing end of line character in google sheets

391 views Asked by At

Is there a way to force cells in google sheet to end with 'enter'? If I'm updating a sheet, I can input a string in cell A1 ... then use the right arrow to move to the B1. Sometimes this is preferable because entering a string and then pressing enter moves the selection cell down to A2 instead of across. The problem is without the invisible 'enter' marker, it messes formatting when combining cells via scripts.

1

There are 1 answers

2
kaza On BEST ANSWER

I would do the below...

setAddress(street.trim()+'\n'+ city.trim());

\n is a new line character.
street.trim() would trim any new line characters if there are any.