Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default delete trailing space in column

B2:B10000 consist of what supposed to be dates.
The only problem is, when I attempt to change format, it wont take.
Found out the problem is a trailing space at end.

I have tried several delete space codes, but to no avail.

Please.... any suggestions to delete trailing spaces?

2009-05-02*
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default delete trailing space in column

Have you tried =TRIM(ref)? In a column next to these dates, insert this
formula and copy down. Then copy the trimmed data and paste special as values
Then delete the incorrect column
--
HTH

Kassie

Replace xxx with hotmail


"J.W. Aldridge" wrote:

B2:B10000 consist of what supposed to be dates.
The only problem is, when I attempt to change format, it wont take.
Found out the problem is a trailing space at end.

I have tried several delete space codes, but to no avail.

Please.... any suggestions to delete trailing spaces?

2009-05-02

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default delete trailing space in column

If familiar with VBA you could write a loop using the Trim function.

Drop a button on the sheet and paste in the following... (Note will
need to substitute "Sheet1" with the name of your sheet.)

Private Sub CommandButton1_Click()

Dim intRow as integer
Dim strCell as string

intRow = 2
intCol = "B"
strCell = "B" & Cstr(intRow)

Do While Len(strCell) 0
Worksheets("Sheet1").Range(strCell) = Trim(Worksheets
("Sheet1").Range(strCell))
intRow = intRow + 1
strCell = intCol & Cstr(intRow)
Loop

End sub

Good luck!

On Apr 27, 1:31*pm, "J.W. Aldridge"
wrote:
B2:B10000 consist of what supposed to be dates.
The only problem is, when I attempt to change format, it wont take.
Found out the problem is a trailing space at end.

I have tried several delete space codes, but to no avail.

Please.... any suggestions to delete trailing spaces?

2009-05-02*


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default delete trailing space in column

was trying to go with vba, however vba code didn't work. may resort to
trim. thanx all
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default delete trailing space in column

trim didnt work either


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete trailing space in column


Is this data imported from Access by any chance?

J.W. Aldridge;324225 Wrote:
trim didnt work either



--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=90578

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default delete trailing space in column

Select the column
Edit|replace
what: (space character)
with: (leave blank)
replace all

If you copied these dates from the web, you may have those HTML non-breaking
spaces in your data.

Change that what to:
What: alt-0160
Hit and hold the alt key while typing the 0160 on the numeric keypad.

==========
Another option would be to
select the column
Data|Text to columns
Fixed width
Draw a line after the last digit
Choose date for the first field (ymd???)
and skip for the second field
and finish up the wizard.

Then format the cells the way you like.


"J.W. Aldridge" wrote:

B2:B10000 consist of what supposed to be dates.
The only problem is, when I attempt to change format, it wont take.
Found out the problem is a trailing space at end.

I have tried several delete space codes, but to no avail.

Please.... any suggestions to delete trailing spaces?

2009-05-02


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default delete trailing space in column

That html thingy was it...

Tried the alt-0160 and it worked.

Thanx!
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
Removing leading and trailing space... Jeffery B Paarsa Excel Discussion (Misc queries) 2 October 8th 09 11:43 PM
How do I delete an extra space in every cell in a column? iamjbunni Excel Discussion (Misc queries) 2 April 21st 06 06:14 PM
(in)definite article and leading/trailing space remover needed KHashmi316[_8_] Excel Programming 25 June 16th 05 06:01 PM
Trailing Space / Format Question hagen Excel Discussion (Misc queries) 4 December 27th 04 11:01 PM
Delete leading or trailing blank spaces in cell - an example DataFreakFromUtah Excel Programming 2 September 16th 04 10:04 PM


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

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

About Us

"It's about Microsoft Excel"