Delete code from a worksheet using the codename for the sheet

  • Hello


    I have the below code that works to delete the code from a worksheet called 142959.


    I want to reference the sheet by it's codename (Sheet13) rather than it's sheetname, because the sheetname will be different each time, but the codename will always be the same.


    I'm sure it's simple, but I can't get it.


    Thanks in advance




  • Re: Delete code from a worksheet using the codename for the sheet


    Stop looking. Thanks to the depth of this site making it easier for dummies to find stuff, I worked it out, and it was VERY simple. I replaced

    Code
    Worksheets("142959").CodeName

    with

    Code
    ActiveSheet.CodeName

Participate now!

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