Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ian ian is offline
external usenet poster
 
Posts: 11
Default Remove non-printing characters

I'm having trouble working with apperently empty cells in a
spreadsheet which has data pasted from a large Word document.


Some cells only look empty. I tried Clean which doesn't work
completetly. I don't want to try Trim as it will replace any double
spaces etc with single spaces.

Using Code on one cell I get 32, telling there is a space in the
cell, (other "empty" cells might have other Codes.)

Is there any simple Macros I can use to delete the contents of
apperently empty cells.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Remove non-printing characters

Loop through the cells, loop through the characters in the cell and use the
replace command with a list of characters you want to remove. You could use
the Like command in your comparisons.

--
Regards,
Tom Ogilvy

"ian" wrote:

I'm having trouble working with apperently empty cells in a
spreadsheet which has data pasted from a large Word document.


Some cells only look empty. I tried Clean which doesn't work
completetly. I don't want to try Trim as it will replace any double
spaces etc with single spaces.

Using Code on one cell I get 32, telling there is a space in the
cell, (other "empty" cells might have other Codes.)

Is there any simple Macros I can use to delete the contents of
apperently empty cells.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Remove non-printing characters

Look at the CLEAN function. You mat also want to look at David McRitchies TRIMALL function:

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

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ian" wrote in message s.com...
| I'm having trouble working with apperently empty cells in a
| spreadsheet which has data pasted from a large Word document.
|
|
| Some cells only look empty. I tried Clean which doesn't work
| completetly. I don't want to try Trim as it will replace any double
| spaces etc with single spaces.
|
| Using Code on one cell I get 32, telling there is a space in the
| cell, (other "empty" cells might have other Codes.)
|
| Is there any simple Macros I can use to delete the contents of
| apperently empty cells.
|
| Thanks
|


  #4   Report Post  
Posted to microsoft.public.excel.programming
ian ian is offline
external usenet poster
 
Posts: 11
Default Remove non-printing characters

Tom

Thanks. I was hoping to do this without specifying the characters to
remove (as I don't know if I'd miss any). Just to empty any cells
which look empty.

Ian

  #5   Report Post  
Posted to microsoft.public.excel.programming
ian ian is offline
external usenet poster
 
Posts: 11
Default Remove non-printing characters

On 7 Nov, 11:54, "Niek Otten" wrote:
Look at the CLEAN function. You mat also want to look at David McRitchies TRIMALL function:

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

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



Thanks for pointers, using WorksheetFunction.Clean and Trim seems to
have worked.

Ian



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Remove non-printing characters

Select your cells and try this:

Sub DeleteBlanks()
Application.ScreenUpdating = False

With Selection.SpecialCells(xlConstants)
.Replace what:=" ", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
End With

Application.ScreenUpdating = True
End Sub



HTH,
JP

On Nov 7, 6:35 am, ian wrote:
I'm having trouble working with apperently empty cells in a
spreadsheet which has data pasted from a large Word document.

Some cells only look empty. I tried Clean which doesn't work
completetly. I don't want to try Trim as it will replace any double
spaces etc with single spaces.

Using Code on one cell I get 32, telling there is a space in the
cell, (other "empty" cells might have other Codes.)

Is there any simple Macros I can use to delete the contents of
apperently empty cells.

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
remove all characters before a certain one Imajica12345 Excel Discussion (Misc queries) 7 June 11th 09 02:53 PM
Remove characters Suraj Noorsai Excel Discussion (Misc queries) 5 July 25th 08 02:44 PM
Remove last 10 characters Supe Excel Discussion (Misc queries) 2 September 5th 07 10:46 PM
Remove first few characters coa01gsb Excel Worksheet Functions 5 March 23rd 06 01:48 PM
I need to remove characters ... Rick Excel Discussion (Misc queries) 2 August 31st 05 06:50 PM


All times are GMT +1. The time now is 10:32 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"