Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removing Leading Space in Cell | Excel Discussion (Misc queries) | |||
removing space and tabs in a cell | Excel Discussion (Misc queries) | |||
removing a space from starting of the text | Excel Worksheet Functions | |||
Removing a space within a cell | Excel Worksheet Functions | |||
removing unwanted characters in a cell | Excel Programming |