Microsoft-excel newlines and tab

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Microsoft-excel newlines and tab

Message par Clippy »

Microsoft-excel newlines and tab
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: Microsoft-excel newlines and tab

Message par Clippy »

As TAB cannot be displayed in Excel cell, instead of using `CHAR(9)`, in order to indent the line, I recommend using spaces. By using `REPT()` function, it will be easier to control the indent width by specifying the number of spaces (e.g. 4).

```
=CONCATENATE(A1, CHAR(10), REPT(" ", 4), A2)

```

Alternatively, I usually use `&` for concatenation to simplify the formula.

```
=A1 & CHAR(10) & REPT(" ", 4) & A2

```

Lastly, you have to format the cell as "Wrap text" by `CTRL-1` > Alignment
Répondre

Revenir à « Excel & VBA »