Removing Leading Space after hard return in cell

Micheleami

New Member
Joined
Mar 21, 2014
Messages
4
I have a spreadsheet with items separated by a semi-colon and use Control + Shift + J to replace the semi-colon with a hard return. The ultimate goal is for all items to be stacked within the cell. However, whether I use Control + Shift + J or macros for replacing a character with a hard return, I'm always left with a space for each return as shown below (post is removing the spaces so pretend there is a space before Oranges and Pears).
Apples
Oranges
Pears
I have been unable to find a solution to remove the spaces before the second, third, fourth, etc. items.
Thoughts?
Thank you in advance!
 
Last edited:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I have a spreadsheet with items separated by a semi-colon and use Control + Shift + J to replace the semi-colon with a hard return. The ultimate goal is for all items to be stacked within the cell. However, whether I use Control + Shift + J or macros for replacing a character with a hard return, I'm always left with a space for each return as shown below (post is removing the spaces so pretend there is a space before Oranges and Pears).
Apples
Oranges
Pears
I have been unable to find a solution to remove the spaces before the second, third, fourth, etc. items.
Thoughts?
Thank you in advance!
I don't understand the Control+Shift+J reference... it does not seem to do anything that I can detect on my computer. How exactly are you using it? Also, maybe you can explain in a little more detail what you have and what you want afterwards so that we can understand better what you are trying to accomplish.
 
Upvote 0
Hi Rick - Sorry for not being clear. I can post a sample spreadsheet, but don't see an attachment option. Basically, I start off with a list of items in a cell separated by a semi-colon and then a space. The space is an issue. Whether I enter a hard return to replace the semi-colon - whether by macro or Find and Replace, the leading space still remains. I cannot find a way to remove that leading space before the items so that the items are neatly in line on top of one another in the cell.
 
Upvote 0
Micheleami,

why don't you replace semicolon AND space with linefeed?
 
Upvote 0
Hi Rick - Sorry for not being clear. I can post a sample spreadsheet, but don't see an attachment option. Basically, I start off with a list of items in a cell separated by a semi-colon and then a space. The space is an issue. Whether I enter a hard return to replace the semi-colon - whether by macro or Find and Replace, the leading space still remains. I cannot find a way to remove that leading space before the items so that the items are neatly in line on top of one another in the cell.
Instead of replacing just the semi-colon, replace both the semi-colon and space. Assuming you are using Excel's Replace dialog box, put this in the "Find what" field...

"; "

but leave off the quote marks. As for what you put in the "Replace with" field... Control+J is all you need to key-in, the Shift key is unnecessary.

On a side note, you cannot attach files in this forum... the best way to do it is to upload the file to DropBox and provide us with the link you get for that file.
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,726
Members
452,667
Latest member
vanessavalentino83

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