Turns text wrapping on or off for cells in a range.
class SpreadsheetApp method .setWrap()
SpreadsheetApp is the Apps Script service.
.setWrap() is the method name you will see after a dot in your code.
What it does
Why it's used
- Keep long notes readable inside a cell.
- Tidy up text columns after a wide paste.
Common errors
- Forgetting parentheses on setWrap. Write SpreadsheetApp.setWrap(), not SpreadsheetApp.setWrap or setWrap by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').setWrap().
- Adding spaces where they do not belong. Write SpreadsheetApp.setWrap(), not SpreadsheetApp .setWrap(), SpreadsheetApp.setWrap (), or SpreadsheetApp . setWrap().
- Wrong capitalization. Use SpreadsheetApp and setWrap, not spreadsheetapp or setwrap.
Snippets using this method
Explore
Related methods
-
.setFontWeight()
Sets text to normal or bold in a range.
-
.setFontColor()
Sets the text color of cells in a range.
-
.setNumberFormat()
Sets how numbers and dates display in a range.
-
.setBackground()
Sets the background color of cells in a range.
-
.setHorizontalAlignment()
Sets left, center, or right alignment for cells in a range.
More Apps Script
Better Sheets tutorials
Anika Asks: How To Set Text Overflow All The Time
Related blog posts
Written guides about SpreadsheetApp.setWrap().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →