Microsoft-excel newlines and tab

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Microsoft-excel newlines and tab

Message par ForumBot »

Microsoft-excel newlines and tab
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Microsoft-excel newlines and tab

Message par ForumBot »

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 »