ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove Spaces (https://www.excelbanter.com/excel-programming/324877-remove-spaces.html)

Ronbo

Remove Spaces
 
In a routine i have tmpName that is a temporary workbook name that is used
in the routine to open other workbooks. I need to remove spaces in the
tmpName. Ex. -WorkBook Name = Test One Two.xls - I need the tmpName to be
"TestOneTwo.xls. How do I remove the spaces?

Any help is truly appreciated.

Regards,
Ronbo

pete

Remove Spaces
 
Google for excel Selection.Replace does this help?

hth Pete

Glenn Ray[_3_]

Remove Spaces
 
Use the Replace function:
tmpName = Replace(Application.ActiveWorkbook.Name," ","",1)

-Glenn Ray


"Ronbo" wrote:

In a routine i have tmpName that is a temporary workbook name that is used
in the routine to open other workbooks. I need to remove spaces in the
tmpName. Ex. -WorkBook Name = Test One Two.xls - I need the tmpName to be
"TestOneTwo.xls. How do I remove the spaces?

Any help is truly appreciated.

Regards,
Ronbo


Ronbo

Remove Spaces
 
Thanks, it works but I have more to the code and have not been able to get it
to work for me. I have to quit now and will not be back at the problem until
tomorrow night or or in the next day or two.

Does anyone know, should I reply to this old thead (and if so will anyone
see it?) or should I start a new question?

"Glenn Ray" wrote:

Use the Replace function:
tmpName = Replace(Application.ActiveWorkbook.Name," ","",1)

-Glenn Ray


"Ronbo" wrote:

In a routine i have tmpName that is a temporary workbook name that is used
in the routine to open other workbooks. I need to remove spaces in the
tmpName. Ex. -WorkBook Name = Test One Two.xls - I need the tmpName to be
"TestOneTwo.xls. How do I remove the spaces?

Any help is truly appreciated.

Regards,
Ronbo



All times are GMT +1. The time now is 01:17 PM.

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