LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Removing special characters and extra white space

doug

Sub TRIM_EXTRA_SPACES()
Dim cell As Range
For Each cell In Selection
If (Not IsEmpty(cell)) And _
Not IsNumeric(cell.Value) And _
InStr(cell.Formula, "=") = 0 _
Then cell.Value = Application.Trim(cell.Value)
Next
End Sub


Gord Dibben Excel MVP

On Wed, 23 Jun 2004 14:54:48 -0500, dougmcc1
wrote:

I was able to get the macro to replace certain special characters with a
space, but now I get some words with many spaces in between them. I use
trim to remove the whitespace from the ends of the final output string
but how do I remove the whitespace between the words?


---
Message posted from http://www.ExcelForum.com/


 
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
Extra White Space Between Cells Leesa Excel Discussion (Misc queries) 1 May 25th 05 07:00 PM
Extra White Space between Cells Leesa Excel Discussion (Misc queries) 1 May 25th 05 06:56 PM
Extra White Space Between Cells Leesa Excel Discussion (Misc queries) 1 May 25th 05 12:17 AM
Extra White Space Between Cells Leesa Excel Discussion (Misc queries) 0 May 24th 05 08:46 PM
Extra White Space Between Cells Leesa Excel Discussion (Misc queries) 0 May 24th 05 08:30 PM


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

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

About Us

"It's about Microsoft Excel"