Whatever message this page gives is out now! Go check it out!
SpreadsheetShiftRows(spreadsheetObj, start[, rows]
SpreadsheetShiftRows(spreadsheetObj, start, end, rows)Parameter | Description |
spreadsheetObj | The Excel spreadsheet object in which to make the shift. |
start | The number of the first row to shift |
end | The number of the last row to shift. If you omit this parameter, the function shifts a single row. |
rows | The positive (down) or negative (up) number of rows by which to shift the rows. If you omit this parameter, the function shifts the row down by one unit. |
<cfscript>
///We need an absolute path, so get the current directory path.
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "shiftrows.xls";
//Create a new Excel spreadsheet object.
theSheet = SpreadsheetNew("Expenses");
//Set some cell values, indicating their initial location.
SpreadsheetSetCellValue(theSheet,"Cell D10",10,4);
SpreadsheetSetCellValue(theSheet,"Cell E11",11,5);
SpreadsheetSetCellValue(theSheet,"Cell A12",12,1);
SpreadsheetSetCellValue(theSheet,"Cell B13",13,2);
//Shift rows 10 and 11 down 2 rows.
SpreadsheetShiftRows(theSheet,10,11,2);
</cfscript>
<!--- Write the spreadsheet to a file, replacing any existing file. --->
<cfspreadsheet action="write" filename="#theFile#" name="theSheet" overwrite=true>