Rename File Name for duplicate

  • Hi,


    I want to save a excel file into particular folder, if the same name file found macro should automatically save this file also with making a same name and adding "Copy" or "duplicate" at the end.


    Eg. Xyz.xls (if same name file found, macro should save this file also with xyz (copy).xls)


    Is there any code then please help.


    Regards,
    Abdul Qaiyum Shaikh

  • Re: Rename File Name for duplicate



    _____________________________________________________________________________________________


    *EDIT*
    When you post code in a message you are required to use Code Tags. These format and colourise the code making it easier to read and so follow the logic. This is one of the rules you agreed to when you joined the forum.


    The tags have been added for you, but this time only. Please ensure future posts comply with the rules.

  • Re: Rename File Name for duplicate


  • Re: Rename File Name for duplicate


    Thanks and I will make ensure rules to be followed and for your great help. The below code which you have provided is showing syntax error Please suggest any modifications required. However other code was useful and successfully run. Thanks....

    Code
    [U][B]ActiveWorkbook.SaveAs Filename:=Path & "\" & Name & ".xls", FileFormat:=xlExcel8[/B][/U]
  • Re: Rename File Name for duplicate


    I'm sorry for mistake

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!