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

spreadsheetClearCellRange

Last update:
May 18, 2026

Description

Clears all styles and values from a specified range of cells.

Returns

None

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetClearCellRange(spreadsheetObject,startRow,startColumn,endRow,endColumn)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object from which to clear cells.
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

<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "inputFile.xls";
    theFile2=GetDirectoryFromPath(GetCurrentTemplatePath()) & "outputFile.xls";
    obj =SpreadsheetRead(#theFile#)
    spreadsheetClearCellRange(obj,10,2,10,2)
    spreadsheetWrite(obj, "#theFile2#", "", "yes", "no")    
    value=spreadsheetGetCellValue(obj,10,2)
    writedump(var=value,format="text")
</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