#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Unwanted spaces

I copy data from a different program and paste it into a spreadsheet and some
of the cells have unused spaces behind the last character. When I link that
data into the cell I want to post it into, it does not center with those 8 or
10 spaces. How do I format my destination cell so it will automatically
remove those spaces? I.E data now = (3/15/07 10:24:30 )
and I want it like (3/15/07 10:24:30)
--
Loren
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Unwanted spaces

I had to create a macro to do just what you are looking for. I would run the
macro before I did my validation or moving, change as you need to:

Sub rmvSpace()
' use on LDA report to remove trailing spaces

Dim strUntrimmed As String, strTrimmed As String
Range("A2").Select

Do
If IsEmpty(ActiveCell) Then
Exit Sub
End If
strUntrimmed = ActiveCell.Text
strTrimmed = RTrim(strUntrimmed)
ActiveCell = strTrimmed
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell) = True

End Sub

"Loren" wrote:

I copy data from a different program and paste it into a spreadsheet and some
of the cells have unused spaces behind the last character. When I link that
data into the cell I want to post it into, it does not center with those 8 or
10 spaces. How do I format my destination cell so it will automatically
remove those spaces? I.E data now = (3/15/07 10:24:30 )
and I want it like (3/15/07 10:24:30)
--
Loren

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Unwanted spaces

Hi Loren,

If the data is always in that format, date, two spaces, hour, minutes,
seconds...

=LEFT(A1,18)&RIGHT(A1,1)

Then copy and paste special values to remove the formulas.

HTH
Regards,
Howard

"Loren" wrote in message
...
I copy data from a different program and paste it into a spreadsheet and
some
of the cells have unused spaces behind the last character. When I link
that
data into the cell I want to post it into, it does not center with those 8
or
10 spaces. How do I format my destination cell so it will automatically
remove those spaces? I.E data now = (3/15/07 10:24:30 )
and I want it like (3/15/07 10:24:30)
--
Loren



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 I remove leading spaces and leave the remianing spaces w Debi Excel Worksheet Functions 6 February 28th 07 03:29 PM
spaces not recognized as spaces windsurferLA Excel Worksheet Functions 9 July 27th 06 11:49 AM
Unwanted Links Rob Excel Discussion (Misc queries) 2 February 25th 06 10:51 AM
Unwanted Cells billy2willy Excel Discussion (Misc queries) 2 September 27th 05 09:45 PM
Unwanted character [email protected] Excel Worksheet Functions 2 May 6th 05 02:21 AM


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