Removing double spacing (multiple CR's) from a group of cells

ou81aswell

Board Regular
Joined
Oct 6, 2009
Messages
50
I have a colleague in Paris who is running Excel 2010 under Windows/ Parallels on a Mac.

He has a number of cells which contain double spaced addresses (multiple carriage returns).

Example:

123 Main Street

Atlanta
Georgia

He's trying to remove the double spacing so it turns out like:

123 Main Street
Atlanta
Georgia


On my computer I can use Excel's replace feature and specify that it replace 2 CR's with a single CR by holding down the Alt key and typing 013 on the numeric keypad to specify the carriage return character. We can't figure out how to do this on a Mac since it doesn't have a numeric keypad.

Is there a macro that I could build that would do this automatically for the currently selected cells in Excel?

Alternatively, does anyone know how to enter ascii key codes via the Mac keyboard under Parallels?

Thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
try this code
Code:
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
s = Chr(10) & Chr(10)
For j = 1 To LR
  Cells(j, 1) = Replace(Cells(j, 1).Text, s, Chr(10))
Next
End Sub

if it does not solve need a sample file for testing
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

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