ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   =clean(a1) (https://www.excelbanter.com/excel-programming/275245-%3Dclean-a1.html)

news.verizon.net

=clean(a1)
 

I want to get rid of special characters from A1. But I want it to be
replaced with space so there are 2 or 3 words:

A1

TESTchar(27)TEST1char(7)TEST2

After clean it should look like this

TEST TEST1 TEST2

Thanks.





Mark Bigelow

=clean(a1)
 
Try this:

strTest = Replace(TESTchar(27)TEST1char(7)TEST2, char(27), " ")

strTest = Replace(strTest, char(7), " ")

Let me know if that doesn't work.

Mark
---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dave Peterson[_3_]

=clean(a1)
 
if it's just char(27) and char(7):
=SUBSTITUTE(SUBSTITUTE(A1,CHAR(27)," "),CHAR(7)," ")

And if there's a chance that those characters will be doubled up:
=TRIM(SUBSTITUTE(SUBSTITUTE(A1,CHAR(27)," "),CHAR(7)," "))

"news.verizon.net" wrote:

I want to get rid of special characters from A1. But I want it to be
replaced with space so there are 2 or 3 words:

A1

TESTchar(27)TEST1char(7)TEST2

After clean it should look like this

TEST TEST1 TEST2

Thanks.


--

Dave Peterson



All times are GMT +1. The time now is 08:04 PM.

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