ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clean up a string (https://www.excelbanter.com/excel-programming/320606-clean-up-string.html)

quartz[_2_]

Clean up a string
 
I have a long string that includes paragraph marks from Word, which I guess
are carriage returns. Does someone have a function I can use to strip these
out of my string?

TIA

Tom Ogilvy

Clean up a string
 
Replace(sStr,chr(10),"")

replace chr(10) with whatever character(s) you are trying to remove.

However, in my test, chr(10) is the correct character for your situation.
--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
I have a long string that includes paragraph marks from Word, which I

guess
are carriage returns. Does someone have a function I can use to strip

these
out of my string?

TIA




Sharad Naik

Clean up a string
 
Another way:

clnStr = Application.WorksheetFunction.Clean(dirtyStr)

Sharad

"Tom Ogilvy" wrote in message
...
Replace(sStr,chr(10),"")

replace chr(10) with whatever character(s) you are trying to remove.

However, in my test, chr(10) is the correct character for your situation.
--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
I have a long string that includes paragraph marks from Word, which I

guess
are carriage returns. Does someone have a function I can use to strip

these
out of my string?

TIA







All times are GMT +1. The time now is 09:02 PM.

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