What CHR code is Alt + Enter?

bmcvicker

New Member
Joined
Nov 25, 2008
Messages
2
Hi there,

I've been struggling for a few hours now trying to sort this problem. I have multiple rows of data that have been entered into excel cells using Alt + Enter. This has created a situation where I have multiple rows in each cell. I need to separate these out and I've tried various extraction methods but none of them (Text to Columns, Replace or VBA) seem to recognise the character that Alt + Enter is using.
It works, if I use a modified excel formula for finding first word, last word, nth word etc from a cell and I insert an Alt + Enter for the character I want to find. For the nth word I need to add a whole section to the formula and it is getting too cumbersome especially with Alt + Enter breaks through it and up to 15 rows in a cell. There is a VBA function that could do the trick (replacing the spaces it looks for with Alt + Enters) but it doesn't recognise the Alt + Enters as Chr(13)'s or vbCrLf's in the spreadsheet.


Any ideas on how I can find these Alt + Enters in VBA and use them in the function or replace them so I can separate this data out?


Thanks,
Brian
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
13 I believe

Edit: Make that 10

Go into Excel, enter it into a cell

Type this in the debug window of the VBE:

?asc(activecell.Text)

Excel can recognise this in formulas too:

=SUBSTITUTE(A1,CHAR(10),"") will replace the Alt-Enter's with nothing.
 
Last edited:
Upvote 0
Hi and welcome to MrExcel!

Alt+Enter = character 10.

To substitute these out of the text using an Excel formula, try this:
=SUBSTITUTE(A1,CHAR(10),",")
where the raw data is in cell A1.

Andrew
 
Upvote 0

Forum statistics

Threads
1,221,455
Messages
6,159,949
Members
451,606
Latest member
ephemeruh

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