ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I delete unprintable characters using VBA in Excel? (https://www.excelbanter.com/excel-programming/341351-how-can-i-delete-unprintable-characters-using-vba-excel.html)

peterv[_5_]

How can I delete unprintable characters using VBA in Excel?
 

I want to delete unprintable characters in an Excel sheet using VBA.
I've tried using the CLEAN function, but can't find the correct syntax
to get it to work in VBA. Can anyone help?
Thanks!


--
peterv
------------------------------------------------------------------------
peterv's Profile: http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=471435


K Dales[_2_]

How can I delete unprintable characters using VBA in Excel?
 
Use WorksheetFunction.Clean(YourString) - for example, if you wanted to clean
the text in cell A3 you would have:
Range("A3").Value = WorksheetFunction.Clean(Range("A3").Value)
--
- K Dales


"peterv" wrote:


I want to delete unprintable characters in an Excel sheet using VBA.
I've tried using the CLEAN function, but can't find the correct syntax
to get it to work in VBA. Can anyone help?
Thanks!


--
peterv
------------------------------------------------------------------------
peterv's Profile: http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=471435



Tom Ogilvy

How can I delete unprintable characters using VBA in Excel?
 
for each cell in Activesheet.UsedRange
cell.Value = Application.Clean(cell.Value)
Next


Just note that if you are bringing in your data from a web page (for
example), there may be characters that CLEAN doesn't clean.

--
Regards,
Tom Ogilvy

"peterv" wrote in
message ...

I want to delete unprintable characters in an Excel sheet using VBA.
I've tried using the CLEAN function, but can't find the correct syntax
to get it to work in VBA. Can anyone help?
Thanks!


--
peterv
------------------------------------------------------------------------
peterv's Profile:

http://www.excelforum.com/member.php...o&userid=25572
View this thread: http://www.excelforum.com/showthread...hreadid=471435




Gord Dibben

How can I delete unprintable characters using VBA in Excel?
 
See David McRitchie's TrimAll code.

http://www.mvps.org/dmcritchie/excel/join.htm#trimall


Gord Dibben Excel MVP


On Wed, 28 Sep 2005 10:18:17 -0500, peterv
wrote:


I want to delete unprintable characters in an Excel sheet using VBA.
I've tried using the CLEAN function, but can't find the correct syntax
to get it to work in VBA. Can anyone help?
Thanks!




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

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