# TRIMCELLS

#### Syntax <a href="#syntax" id="syntax"></a>

**TRIMCELLS**(*range*; *direction*; *option*)

* *range* - the range in which empty rows or columns should be trimmed - ***Value type**: range*
* *direction* - the direction in which the range should be trimmed - ***Value type**: constant (optional, default: horizontal)*

  Possible values are

  * *horizontal* - trim empty columns
  * *vertical* - trim empty rows
  * *all* - trim both empty rows and empty columns
* *option* - specifies if empty rows or columns inside the range should be removed - ***Value type**: constant (optional, default: outside)*

  Possible values are

  * *outside* - only the first or last empty rows or columns are removed
  * *inside* - only empty rows or columns that have non-empty cells anywhere to the left and the right (or above and below them) are removed
  * *both* - all empty rows or columns outside and inside are removed

#### Remarks <a href="#remarks" id="remarks"></a>

* This function is useful for creating a more compact representation of a range by removing unwanted empty rows or columns.
* The *inside* option is particularly useful for removing empty rows or columns that appear between non-empty content, while preserving the overall structure where needed.
