problem with vba code

Copper Contributor

have this code in a vba (with workbooks("book1") .worksheets("22") . sort). started out with 15 worksheets in this workbook and this code works fine on these. needed to expand to a 16th worksheet, copied sheet and changed name but code will not work on this sheet?

1 Reply


With your permission, if I can recommend you, please always add specific information about your Excel version and operating system to your concerns. As well as, if possible or necessary, a file (without sensitive data) or photos or in your case the VBA code. Information on where the file is, such as OnDrive or Sharepoint, is of advantage. In this way, you will come up with a proposed solution much faster and more precisely. This also makes it much easier for the other users to provide the help that they would like to offer you. It helps both :).


Here is a link with information on how you can quickly find a solution that is most suitable for you.

Welcome to your Excel discussion space!




Thank you for your understanding



I know I don't know anything (Socrates)