Copy and Rename a Worksheet

  • Hi Folks,
    I have a workbook that has a hidden worksheet within.
    There is a command button which I am trying to get working which copies the hidden sheet, places it at the end of all other sheets
    then renames it.


    I am trying to get the if exists error handling correct but I get error on "If WorksheetExists(wsName) Then"


    If possible can some give me an idea why this is not working on my sheet.


    For information, I have this method working perfectly in another workbook !
    Version is Excel 2016



    Thank you





  • Re: Copy and Rename a Worksheet


    You can try this:

  • Re: Copy and Rename a Worksheet


    Hi, Appreciate the response.


    The code provided appears to work great except that it copies the hidden sheet as another hidden sheet
    I need to copy the new sheet as a visible sheet if that is possible please?


    Thank you

  • Re: Copy and Rename a Worksheet


    Add this line After Dim line

    Code
    Worksheets("Do Not Use").Visible = True


    And this Before End Sub

    Code
    Worksheets("Do Not Use").Visible = False

Participate now!

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