Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove spaces from a string variable
Use the Replace method of Strings: * To remove all spaces: Replace(YourStringWithSpaces, " ", "") * To replace spaces with underscores: Replace(YourStringWithSpaces, " ", "_") Hope this helps... blatham Wrote: Does anyone know if there is a function to remove or replace spaces within a string variable in VBA. I want something similar to the TRIM function that also removes spaces from middle of the string as well as the ends. Thanks -- T-Žex ------------------------------------------------------------------------ T-Žex's Profile: http://www.excelforum.com/member.php...o&userid=26572 View this thread: http://www.excelforum.com/showthread...hreadid=398507 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I remove all spaces in a text string | Excel Discussion (Misc queries) | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
Find String in another string - only between spaces | Excel Worksheet Functions | |||
how do I remove empty spaces trailing a text string? | Excel Worksheet Functions | |||
Remove Spaces | Excel Programming |