简体   繁体   中英

apps script concatenate with line breaks

I'm trying to get a line break with my Google apps script:

ss.getRange('Y'+lastRow).setFormula('CONCATENATE(F'+lastRow+'&"\\n"&G'+lastRow+'&" "&H'+lastRow+')')

I'm not seeing a line break though. Any ideas?

You can use template literals

To achieve your goal just put the second line into a new row:

   ss.getRange('Y'+lastRow).setFormula
   (
   `CONCATENATE(F${lastRow}&" " 
    &G${lastRow}&" "&H${lastRow})`
   )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM