Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Removing unwanted space at end of text cell

I have a Column of branch names but they all have a lot of spaces after the
name, is the anyway with VB that I can trim to just the branch name?

Thanks........ Alastair.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Removing unwanted space at end of text cell

If you want to trim the cell values in situ, you need to do it with code:

e.g.
range("E4").Formula=trim(Range("E4").value)

trims (removes leading & trailing blanks) from the contents of E4.

For a given range, try:

Sub aa()
For Each ThisCell In Range("A1:B4") ' specify your rangel
ThisCell.Formula = Trim(ThisCell)
Next
End Sub

"Alastair79" wrote:

I have a Column of branch names but they all have a lot of spaces after the
name, is the anyway with VB that I can trim to just the branch name?

Thanks........ Alastair.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Removing unwanted space at end of text cell

have a look in help index for TRIM
To trim intervening spaces you may need
application.trim
see excel help

--
Don Guillett
SalesAid Software

"Alastair79" wrote in message
...
I have a Column of branch names but they all have a lot of spaces after the
name, is the anyway with VB that I can trim to just the branch name?

Thanks........ Alastair.



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 Space in Cell Beverly-Texas Excel Discussion (Misc queries) 1 October 15th 09 08:43 PM
removing space and tabs in a cell mr_nice! Excel Discussion (Misc queries) 5 November 28th 05 01:27 PM
removing a space from starting of the text shikha Excel Worksheet Functions 3 September 24th 05 11:16 PM
Removing a space within a cell JERRY8 Excel Worksheet Functions 3 December 2nd 04 03:22 AM
removing unwanted characters in a cell Andrea[_7_] Excel Programming 3 October 30th 03 07:45 AM


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