LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Trim function as a procedure - a simple example

No question here, just a very simple example procedure for the archive

Sub RemoveAllBlankSpacesButOne()

'Removes all blank spaces = 2 and replaces
'them with just one blank space

Dim cell As Range
On Error Resume Next
For Each cell In Selection
cell.Value = WorksheetFunction.Trim(cell.Value)
Next cell

End Sub

Search critera:
Remove all spaces from a text string except for single spaces between
words and numbers
Remove continous blank spaces greater than two
Trim function as a procedure
Replace continous blank spaces with just one blank space
Trim down blank spaces to one space

 
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
A Simple Trim N1KO Excel Discussion (Misc queries) 6 February 12th 09 12:22 AM
Is there a simple procedure to hide rows if a condition is met fishingengineer Excel Discussion (Misc queries) 1 April 13th 07 08:26 PM
Excel crashes on simple procedure Daves_Solutions[_2_] Excel Programming 6 June 14th 06 06:05 AM
Is there a simple procedure to set my macros in Excel 2003 to be . shelley New Users to Excel 1 April 22nd 05 10:04 PM
HELP using simple TRIM function on relative columns Skip Albertson Excel Programming 2 December 27th 04 10:41 PM


All times are GMT +1. The time now is 08:49 AM.

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"