ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Replacing carriage returns with a comma (https://www.excelbanter.com/excel-discussion-misc-queries/229418-replacing-carriage-returns-comma.html)

Sue Compelling

Replacing carriage returns with a comma
 
Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...

Help

TIA

--
Sue Compelling

Bob Phillips[_3_]

Replacing carriage returns with a comma
 
With Activecell

.Value = Replace(.Value, Chr(10),",")
End With

--
__________________________________
HTH

Bob

"Sue Compelling" wrote in message
...
Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...

Help

TIA

--
Sue Compelling




FSt1

Replacing carriage returns with a comma
 
hi
see this site...
http://en.allexperts.com/q/Excel-105...-returns-1.htm

regards
FSt1

"Sue Compelling" wrote:

Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...

Help

TIA

--
Sue Compelling


Sue Compelling

Replacing carriage returns with a comma
 
Thanks FSt1 for the quick response - I also kept searching and discovered the
very simple

Find CTL J
Replace ,
Replace ALL

Brilliant


--
Sue Compelling


"FSt1" wrote:

hi
see this site...
http://en.allexperts.com/q/Excel-105...-returns-1.htm

regards
FSt1

"Sue Compelling" wrote:

Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...

Help

TIA

--
Sue Compelling


smartin

Replacing carriage returns with a comma
 
Sue Compelling wrote:
Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...


This might work for you

=SUBSTITUTE(A1,CHAR(10),",")


David

Replacing carriage returns with a comma
 
thanks sue the ctrl J worked for me. the Alt 013 didnt - saved me a couple of
couple of delete down arrow, delete down arrow, delete down arrow.

"Sue Compelling" wrote:

Thanks FSt1 for the quick response - I also kept searching and discovered the
very simple

Find CTL J
Replace ,
Replace ALL

Brilliant


--
Sue Compelling


"FSt1" wrote:

hi
see this site...
http://en.allexperts.com/q/Excel-105...-returns-1.htm

regards
FSt1

"Sue Compelling" wrote:

Hi

I have an address cell which has data with multiple lines - eg:

School of Science
Medical University

and I want to do a Find all: carriage returns and replace with a comma -
though I don't know the code to use for the carriage returns ...

Help

TIA

--
Sue Compelling



All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com