Hi,
I need to have the name of the workbook in cell a1 but without the ".xls"
If I do:
Range("a1").Value = ActiveWorkbook.Name
I get the NAME.xls
Thanks,
M
Hi,
I need to have the name of the workbook in cell a1 but without the ".xls"
If I do:
Range("a1").Value = ActiveWorkbook.Name
I get the NAME.xls
Thanks,
M
Left(ActiveWorkbook.Name, Instr(ActiveWorkbook.Name,".")-1) will give you what you are looking for.
I would use InstrRev, some people (I do :-)) put dots in their filenames
Left(ActiveWorkbook.Name, InStrRev(ActiveWorkbook.Name, ".") - 1)
--
HTH
Bob Phillips
"Rich_z" <[email protected]> wrote in
message news:[email protected]...
>
> Left(ActiveWorkbook.Name, Instr(ActiveWorkbook.Name,".")-1) will give
> you what you are looking for.
>
>
> --
> Rich_z
> ------------------------------------------------------------------------
> Rich_z's Profile:
http://www.excelforum.com/member.php...o&userid=24737
> View this thread: http://www.excelforum.com/showthread...hreadid=386137
>
I'd just assume it is a length of 4
Left(ActiveWorkbook.Name, len(ActiveWorkbook.Name) - 4)
--
Regards,
Tom Ogilvy
"Bob Phillips" <[email protected]> wrote in message
news:[email protected]...
> I would use InstrRev, some people (I do :-)) put dots in their filenames
>
> Left(ActiveWorkbook.Name, InStrRev(ActiveWorkbook.Name, ".") - 1)
>
> --
> HTH
>
> Bob Phillips
>
> "Rich_z" <[email protected]> wrote in
> message news:[email protected]...
> >
> > Left(ActiveWorkbook.Name, Instr(ActiveWorkbook.Name,".")-1) will give
> > you what you are looking for.
> >
> >
> > --
> > Rich_z
> > ------------------------------------------------------------------------
> > Rich_z's Profile:
> http://www.excelforum.com/member.php...o&userid=24737
> > View this thread:
http://www.excelforum.com/showthread...hreadid=386137
> >
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks