# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nedyx.com/nedyx/clearlines-functions/range-functions/trimcells.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
