ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variable for workbook name (https://www.excelbanter.com/excel-programming/309328-variable-workbook-name.html)

Mervyn Thomas

Variable for workbook name
 
I'm sure this must be a simple one but I cannot get my stupin brain around
it!
the line of code " Openbook =activeWorkbook.name" returns a string with the
workbook name including the ".xls". The question is how do I strip out the
".xls" from the string?



Tom Ogilvy

Variable for workbook name
 
OpenBook = ActiveWorkbook.Name
OpenBook = Left(OpenBook,Len(OpenBook)-4)

--
Regards,
Tom Ogilvy

"Mervyn Thomas" wrote in message
...
I'm sure this must be a simple one but I cannot get my stupin brain around
it!
the line of code " Openbook =activeWorkbook.name" returns a string with

the
workbook name including the ".xls". The question is how do I strip out

the
".xls" from the string?





Iain King

Variable for workbook name
 

"Mervyn Thomas" wrote in message
...
I'm sure this must be a simple one but I cannot get my stupin brain around
it!
the line of code " Openbook =activeWorkbook.name" returns a string with

the
workbook name including the ".xls". The question is how do I strip out

the
".xls" from the string?



Openbook = Left$( Openbook, Len( Openbook) - 4)

Iain King




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

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