Whatever message this page gives is out now! Go check it out!

spreadsheetSetCellRangeValue

Last update:
May 18, 2026

Description

Sets the values of a range of cells to a specified value.

Returns

None

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetSetCellRangeValue(spreadsheetObject,value,startRow,startColumn,endRow,endColumn)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object from which to set the cell as active.
value
Yes
Any
The value to set on the cell range.
startRow
Yes
Integer
The start row number of cell range.
startColumn
Yes
Integer
The start column number of cell range.
endRow
Yes
Integer
The end row number of cell range.
endColumn
Yes
Integer
The end column number of cell range.

Example

<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from query
    spreadsheetAddRows(theSheet,art)
    // set cell range value 55,1 to 55,8
    // with the string "This is a value"
    spreadsheetSetCellRangeValue(theSheet,"This is a value",55,1,55,8,"String")
    spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page