-
-
Notifications
You must be signed in to change notification settings - Fork 36
addColumn
Julian Halliwell edited this page Aug 6, 2024
·
15 revisions
Adds a column or column data to a spreadsheet object.
addColumn( workbook, data [, startRow [, startColumn [, insert [, delimiter [, autosize [, datatype ] ] ] ] ] ] )
-
workbook
spreadsheet object -
data
string OR array: Either a delimited list of cell values or an array of values. The default list delimiter is a comma, but you can specify a different delimiter.
-
startRow
numeric: the number of the row at which to start adding the column data. -
startColumn
numeric: the number of the column in which to add the data. -
insert
boolean default=false: ifstartColumn
is specified, whether to insert the new data, shifting existing columns to the right, or replace the existing column. Has no effect ifstartColumn
is not specified. -
delimiter
string default=",": the character separating column values in yourdata
if passed as a list. If your values contain commas, use an alternative delimiter not contained in your data, e.g. |, or preferably pass the data as an array. -
autosize
boolean default=false: whether to adjust the column width automatically to fit the data added. -
datatype
string: force the value to be set as one of the following data types:- "blank"
- "boolean"
- "date"
- "numeric"
- "string"
Chainable? Yes.
spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.addColumn( workbook,"a,b" );
// If your data contains commas, use a different delimiter
spreadsheet.addColumn( workbook=workbook,data="Champion, the wonder horse|Bagpuss",delimiter="|" );