Appearance
Function: cleanRows()
ts
function cleanRows(
ws: Worksheet,
rows: number[],
columns?: string[]): void;Defined in: packages/excel-tools/lib/excel.d.ts:95
Clear cells in specified rows. If columns are provided, only those columns are cleared. Otherwise all cells in each row are cleared.
Parameters
| Parameter | Type | Description |
|---|---|---|
ws | Worksheet | The worksheet containing the rows and columns. |
rows | number[] | Row numbers to clear (e.g., [5, 6, 10]). |
columns? | string[] | Column letters to clear. If empty, all cells in the row are cleared. |
Returns
void
Example
ts
const worksheet = workbook.getWorksheet('Log');
cleanRows(worksheet, [5, 6, 10]);
cleanRows(worksheet, [5, 6, 10], ['C', 'D', 'E']);