adding spaces in front of text and "alt enter:" tabs in one cell (address)

JSH720

Board Regular
Joined
Oct 9, 2009
Messages
109
Office Version
  1. 365
Platform
  1. Windows
I have an address that is in one cell formatted with:
Name
address
address2

city state zip

There is a hard tab (alt tenter) between the lines after the first line. (the bolded lines) I need to keep everything in one cell, and add five spaces in front of each line. I need to be able to do this with a formula (for clients that won't let me use macros) and as a macro that I can use on various spreadsheets

Any help is appreciated

Thank you.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Cells contain either a value or a formula, not both.
Since you have a value already in those cells the only way to do this would be by either using a helper column (a column that has a formula and refers to column A) or VBA.
So in column B you would have

=" "&SUBSTITUTE(A1,CHAR(10),CHAR(10)&" ")
(the forum has reduced my 5 spaces to a single space)
and format the cell as per column A.

Or use VBA.
 
Last edited:
Upvote 0
Thanks, I'll try it. VBA would be awesome for when I can use it.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top