Skip to main content

Clear Spreadsheet

Command description

Clear the content, formatting, or both from the specified spreadsheet range.

Command Input Parameters

input parametersInput parameter typeDescription
Excel ObjectExcelApp
Clear MethodenumAll, Content, Format
Start Row NumberstrOne-based row number; -n means the nth row from the bottom
Start Column NamestrColumn letter such as A or a one-based column number; -n means the nth column from the right
End Row NumberstrOne-based row number; -n means the nth row from the bottom
End Column NamestrColumn letter such as A or a one-based column number; -n means the nth column from the right
sheetstrWorksheet name. Defaults to the active worksheet

Command Output Parameters

None

Clear Methods

  • Content

    Clears cell values and formulas while preserving formatting such as fonts, colors, and borders.

  • Format

    Clears cell formatting while preserving values and formulas.

  • All

    Clears both cell contents and formatting.

Example