#1   Report Post  
Posted to microsoft.public.excel.misc
Raj Raj is offline
external usenet poster
 
Posts: 130
Default Space in text

when I copy text from on sheet to anoth, the destination after the paste has
one space in front of the text. how do i remove the space from multiple cells
at the same time
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Space in text

"Raj" wrote in message
...
when I copy text from on sheet to anoth, the destination after the paste
has
one space in front of the text. how do i remove the space from multiple
cells
at the same time



If this is just a one-time cleanup you need to do, use the TRIM() function
in another column.

For instance, if you have this in A5, and the underline represents a space:

_This is some text.

You'd put this in another column:

TRIM(A5)

Then, use copy & paste special-value to copy the repaired text back into the
original column.

If this problem is a recurring one, you need to find out why, or perhaps
someone can suggest some VBA code that will scan the whole column and make
the necessary changes.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Space in text

If a one-time operation see the other reply about using TRIM function by
formula.

If an on-going problem use this macro on the selection.

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 MS Excel MVP

On Sat, 10 May 2008 16:31:01 -0700, Raj wrote:

when I copy text from on sheet to anoth, the destination after the paste has
one space in front of the text. how do i remove the space from multiple cells
at the same time


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
how do you add a space when merging text using & ? eddie Excel Discussion (Misc queries) 2 May 3rd 07 08:42 PM
How do I separate text without a space? trainer07 Excel Discussion (Misc queries) 6 March 7th 07 01:11 AM
Adding a space in text MB Excel Worksheet Functions 6 May 19th 06 07:15 PM
Remove Space in Text Tian Excel Discussion (Misc queries) 5 April 6th 06 07:09 PM
Find last space from the right of text Myrna Larson Excel Discussion (Misc queries) 5 March 29th 05 12:15 AM


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