Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
XL.Sheet.SetCellFormats
Set cell formats in given area.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| XL | 8.0 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| bookRef | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref | |
| sheetIndex | The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. | 0 | |
| First row | The first row to process. First row has index 0. | 3 | |
| Last row | The last row to process. First row has index 0. | 6 | |
| First column | The first column to process. First column has index 0. | 2 | |
| Last column | The last column to process. First column has index 0. | 4 | |
| Formats | The format to use. Can be separated with row and column delimiter to give each row and column a different format. But you can also use same format for all rows or for all columns. |
$dollarFormat | |
| Row Delimiter | The row delimiter for the result. Default is new line character. |
"¶" | Optional |
| Column Delimiter | The column delimiter for the result. Default is tab character. |
char(9) | Optional |
Result
Returns number of errors or error.
Description
Set cell formats in given area.Examples
Write bold row and data rows:
# create bold font & format
Set Variable [ $boldFont ; Value: MBS( "XL.Book.AddFont"; $bookRef) ]
Set Variable [ $r ; Value: MBS( "XL.Font.SetBold"; $bookRef; $boldFont; 1) ]
Set Variable [ $boldFormat ; Value: MBS( "XL.Book.AddFormat"; $bookRef) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetFont"; $bookRef; $boldFormat; $boldFont) ]
# Write a title row
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteTexts"; $bookRef; $sheet; 1; 1; 1; 4; "A,B,C,D"; ¶; "," ) ]
# Make it bold
Set Variable [ $r ; Value: MBS( "XL.Sheet.SetCellFormats"; $bookRef; $sheet; 1; 1; 1; 4; $boldFormat ) ]
# and write data
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteTexts"; $bookRef; $sheet; 2; 5; 1; 4; $data; ¶; "," ) ]
See also
- XL.Book.AddFont
- XL.Book.AddFormat
- XL.Book.SheetCount
- XL.Format.SetFont
- XL.LoadBook
- XL.Sheet.CellWriteText
- XL.Sheet.CellWriteTexts
- XL.Sheet.GetCellFormat
- XL.Sheet.GetCellFormats
- XL.Sheet.SetCellFormat
Blog Entries
Release notes
- Version 8.0
- Added XL.Sheet.CellReadBooleans, XL.Sheet.CellReadComments, XL.Sheet.CellReadDates, XL.Sheet.CellReadFormulas, XL.Sheet.CellReadNumbers, XL.Sheet.CellReadTexts, XL.Sheet.CellWriteBlanks, XL.Sheet.CellWriteBooleans, XL.Sheet.CellWriteComments, XL.Sheet.CellWriteDates, XL.Sheet.CellWriteFormulas, XL.Sheet.CellWriteNumbers, XL.Sheet.CellWriteTexts, XL.Sheet.GetCellErrors, XL.Sheet.GetCellFormats, XL.Sheet.RemoveComments and XL.Sheet.SetCellFormats.
Created 15th January 2018, last changed 28th May 2018
XL.Sheet.SetCellFormat - XL.Sheet.SetCol
Feedback: Report problem or ask question.
Links
MBS FileMaker Plugins