Clear Excel Range
Clear Excel Range
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”Ninguno — pero debes indicar session o path.
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
session | expression | Excel Open session (instead of path). |
path | expression | Route to .xlsx (required if there is no session). |
sheet | expression | Name or index of the sheet. By default, the first. |
range | expression | Range to delete, e.g. "A1:D20". By default, the entire used area. |
clearFormat | boolean | Also clear the cell formatting. Default false (content only). |
Example
Section titled “Example”Clean a results sheet before filling it out again:
Excel Open path = = asset("tablero.xlsx") → output: libroClear Excel Range session = = libro sheet = "Resultados"Write Excel Sheet session = = libro sheet = "Resultados" data = = nuevosDatosExcel Close session = = libroRelated activities
Section titled “Related activities”- Write Excel Sheet — write by clearing the sheet in one step.
- Get Used Range — know which area has data.