Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete characters at the end Stan Excel Discussion (Misc queries) 5 July 9th 09 08:26 PM
Can you make an Excel Worksheet unprintable ibvalentine Excel Discussion (Misc queries) 2 March 9th 07 01:31 AM
Delete first few cell characters mohd21uk via OfficeKB.com Excel Discussion (Misc queries) 4 June 7th 06 12:32 PM
Delete characters Alex Excel Programming 1 August 9th 04 02:37 PM
Delete characters in cell AuthorizedUserPF[_2_] Excel Programming 3 July 14th 03 04:41 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"