+ Reply to Thread
Results 1 to 2 of 2

Renaming File

  1. #1
    Arjun Dutta
    Guest

    Renaming File

    Hi please help me out on this...
    Everytime i save the file, the file name should be changed to test1.xls;
    second time i open & save the file, the name changes to Test2.xls & so on....

  2. #2
    Bob Phillips
    Guest

    Re: Renaming File

    Put a _ before the number, like Test_2, and then use

    With ActiveWorkbook
    iPos = InStr(.Name, "_")
    iFile = Mid(.Name, iPos + 1, InStr(.Name, ".") - iPos - 1)
    .SaveAs Left(.Name, iPos) & (iFile + 1) & ".xls"
    End With


    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "Arjun Dutta" <[email protected]> wrote in message
    news:[email protected]...
    > Hi please help me out on this...
    > Everytime i save the file, the file name should be changed to test1.xls;
    > second time i open & save the file, the name changes to Test2.xls & so

    on....



+ 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