+ Reply to Thread
Results 1 to 4 of 4

Workbook name

  1. #1
    Registered User
    Join Date
    06-17-2005
    Posts
    13

    Question Workbook name

    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

  2. #2
    Registered User
    Join Date
    06-29-2005
    Location
    England
    Posts
    50
    Left(ActiveWorkbook.Name, Instr(ActiveWorkbook.Name,".")-1) will give you what you are looking for.

  3. #3
    Bob Phillips
    Guest

    Re: Workbook name

    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
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: Workbook name

    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
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1