Concatenate spaces before each alt-enter seperated value in a cell?

W

walterbyrd

I hope I am making sense.

Within one cell, I have several values seperated by alt-enter. So it
looks this:

abcdef <alt-enter>
abcdef <alt-enter>
abcedf <alt-enter>

I want spaces before each "abcdef" so it will look like this:

abcdef <alt-enter>
abcdef <alt-enter>
abcedf <alt-enter>
 
D

Dave Peterson

This gets close:

=REPT(" ",4)&SUBSTITUTE(A1,CHAR(10),CHAR(10)&REPT(" ",4))

But it actually adds extra characters at the right end of the string.

Change the 4 (in both spots) to how many space characters you want.
 
R

Ron Rosenfeld

I hope I am making sense.

Within one cell, I have several values seperated by alt-enter. So it
looks this:

abcdef <alt-enter>
abcdef <alt-enter>
abcedf <alt-enter>

I want spaces before each "abcdef" so it will look like this:

abcdef <alt-enter>
abcdef <alt-enter>
abcedf <alt-enter>

Another approach, if what you want is the "appearance" would be to
right-justify the cell.
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top