Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Deleting blanks from the end of values in cells

Todd

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, 31 Mar 2004 06:50:42 -0800, "Todd Huttenstine"
wrote:

I have a very big range of data on a worksheet. The range
is located on worksheet Renewals A:F. Another worksheet
Wkly Renewals has a pivot table referencing that range.
Some values in the range may have a space (" ") at the end
of the value and needs to be removed.

For example cell D205 should be "Todd Huttenstine" but
instead it is "Todd Huttenstine " or cell D206 may have
the value "Randy " instead of "randy". I need these
spaces removed with code because my pivot table is showing
duplicates due to this space. The pivot tables looks at
this as 2 different values because technically the space
makes it that way.

Any help is appreciated.

Todd Huttenstine


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
Deleting blanks Marianne Excel Discussion (Misc queries) 10 September 10th 08 10:29 AM
Replace values in shaded cells with blanks sue Excel Discussion (Misc queries) 3 January 11th 07 01:20 AM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
delete values in several cells without deleting the formulas dranreb Excel Discussion (Misc queries) 4 December 9th 04 01:15 AM
Deleting blanks and shifting left - cont. jrb[_4_] Excel Programming 3 February 27th 04 02:23 AM


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