ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trim like worksheet Trim (https://www.excelbanter.com/excel-programming/274875-re-trim-like-worksheet-trim.html)

Bob Phillips[_5_]

Trim like worksheet Trim
 
Otto,

UseReplace

Debug.Print Replace(" This is long word ", " ", "")


--

HTH

Bob Phillips

"Otto Moehrbach" wrote in message
...
Excel 2002, Win XP
The worksheet Trim function trims all the spaces, leading, trailing,

and
all but one space between words.
In VBA I have LTrim for leading spaces, RTrim for trailing spaces, and
Trim for both.
I realize that I can use the worksheet Trim function in VBA to do all
the spaces, but is there another way in VBA to get the same functionality

as
the worksheet Trim function?
Thanks for your help. Otto






All times are GMT +1. The time now is 06:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com