The way I solved the problem was to add the code module once the user input was received. Initially, I added the code module for several sheets as the workbook was opened, I removed the part that depended on the sheet using the user input and added it after the input was received.
Bookmarks