Rename sheets

  • Hello,


    Can someone help me with a VBA code that will renames my selected sheets, depending on a list in a given sheet?
    The sheets may be continuous or not.


    Thanks in advance for any help.

  • Hi Tom.Jones,


    Try this where the sheets that have been selected prior to running the macro will be renamed to what's in A2:A(last row in Col. A) of 'Sheet2':



    Note there's no check if the proposed name is valid or it already exists in the workbook.


    Robert

  • Thank you very much, Trebor76.
    Code VBA works well but I need to exclude sheet where run that code.
    Thank you.


    I did not manage to exclude the sheet from where I run the VBA code

  • Is this what you're after:



    Robert

  • Robert, BIG THANKS


    If I select 4 sheets, the second VBA code rename only first 3 sheets
    I manage to make a small change in your code and now is OK. Thank you for helping me.

  • Quote

    If I select 4 sheets, the second VBA code rename only first 3 sheets


    Correct - it won't rename the sheet you're on when you run the code as I thought that was what you were after. If you've sorted it now that's great.


    Robert

Participate now!

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