Skip to content
Julian Halliwell edited this page Sep 20, 2021 · 8 revisions

Shifts one or more columns to the left or right. The contents of the shifted column or columns, including empty cells, overwrites data in the column or columns to which it is shifted.

shiftColumns( workbook, start [, end [, offset ] ] )

Required arguments

  • workbook spreadsheet object
  • start numeric: The number of the first, or only, column to shift.

Optional arguments

  • end numeric: The number of the last column to shift. If omitted the function shifts a single column.
  • offset numeric default=1: The positive (right) or negative (left) number of columns to shift by. If omitted the function shifts the column right by one.

Chainable? Yes.

Example

spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.addColumn( workbook,"a,b" );
spreadsheet.addColumn( workbook, "c,d" );
spreadsheet.shiftColumns( workbook, 1, 1, 1 );
Clone this wiki locally