Skip to content

Clear Excel Range

Type: excel-clear-range  ·  Package: Excel Activities v1.0.0

Deletes the content of a range of cells or the entire sheet. Use it to clean up old data before writing new ones, or to clear a temporary work area. Optionally you can also delete the formatting (colors, borders), not just the values.

Empties the cells in the indicated range (or, if you omit it, the entire data area of the sheet). By default it deletes only the content; with clearFormat = true it also removes the format. Accepts session or path — see the two modes.

Ninguno — pero debes indicar session o path.

ParameterEditorDescription
sessionexpressionExcel Open session (instead of path).
pathexpressionRoute to .xlsx (required if there is no session).
sheetexpressionName or index of the sheet. By default, the first.
rangeexpressionRange to delete, e.g. "A1:D20". By default, the entire used area.
clearFormatbooleanAlso clear the cell formatting. Default false (content only).

Clean a results sheet before filling it out again:

Excel Open path = = asset("tablero.xlsx") → output: libro
Clear Excel Range session = = libro sheet = "Resultados"
Write Excel Sheet session = = libro sheet = "Resultados" data = = nuevosDatos
Excel Close session = = libro