Here is a quick description of VBA modules.
If the code is in a standard module, like Module1, the Range reference defaults to whatever sheet is active when the code runs.
If the code is in a worksheet module, like Sheet1, the Range reference defaults to the sheet for that module.
If the range Mandatory is in a worksheet that is not the default worksheet based on the description above, then it might help to explicitly qualify it using the worksheet it is in:
Change Sheet1 to the sheet actually containing "Mandatory".
I'm not 100% sure that will work but that is typically what causes that error in my own code. I would be happy to troubleshoot it if you attach your file, otherwise we'll tackle it this way.
Bookmarks