Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Trim all but the first 5 characters in cell

How would I write the trim to leave only the first five characters in a
column?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trim all but the first 5 characters in cell

Dim rng as Range, cell as Range
With Activesheet
set rng = Intersect(.usedRange,.columns(5)).Cells
End With
for each cell in rng
cell = Left(cell.Text,5)
Next

--
Regards,
Tom Ogilvy

"Annette" wrote in message
...
How would I write the trim to leave only the first five characters in a
column?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Trim all but the first 5 characters in cell

that does the trick .. thanks!
"Tom Ogilvy" wrote in message
...
Dim rng as Range, cell as Range
With Activesheet
set rng = Intersect(.usedRange,.columns(5)).Cells
End With
for each cell in rng
cell = Left(cell.Text,5)
Next

--
Regards,
Tom Ogilvy

"Annette" wrote in message
...
How would I write the trim to leave only the first five characters in a
column?






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
Trim characters Ronbo Excel Worksheet Functions 7 January 26th 09 09:29 PM
Trim Characters Other Than An Empty Space At The End Of A Cell K8_Dog Excel Worksheet Functions 5 April 19th 08 01:29 AM
How do you trim characters? Tommi Excel Worksheet Functions 6 January 29th 06 01:38 PM
Trim the last two characters? Craig[_8_] Excel Programming 4 September 7th 04 02:52 AM
Trim characters Ange[_3_] Excel Programming 1 August 25th 04 07:31 PM


All times are GMT +1. The time now is 04:05 PM.

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"