+ Reply to Thread
Results 1 to 3 of 3

SaveAs Code

  1. #1
    Ronbo
    Guest

    SaveAs Code

    What is the correct code to save the current workbook (Book1.xls) as
    (Book1A.xls)

    Thanks for the help.

  2. #2
    Executor
    Guest

    Re: SaveAs Code

    Hi Ronbo,

    Try this:

    ' Get the filename with path
    sName = ThisWorkbook.FullName
    ' Add an 'A' to the end of the filename
    sName = Left(sName, Len(sName) - 4) & "A.xls"
    'Save under new name
    ThisWorkbook.SaveAs sName

    Hoop This Helps,


    Executor


  3. #3
    Ronbo
    Guest

    Re: SaveAs Code

    Thanks. Exactly what I was looking for.

    "Executor" wrote:

    > Hi Ronbo,
    >
    > Try this:
    >
    > ' Get the filename with path
    > sName = ThisWorkbook.FullName
    > ' Add an 'A' to the end of the filename
    > sName = Left(sName, Len(sName) - 4) & "A.xls"
    > 'Save under new name
    > ThisWorkbook.SaveAs sName
    >
    > Hoop This Helps,
    >
    >
    > Executor
    >
    >


+ 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