I am using the following script to unlock the sheets in a workbook:
Sub WorksheetsUnlock(sheetName1, sheetName2)
Worksheets(sheetName1).Unprotect “ABC”
Worksheets(sheetName2).Unprotect “ABC”End Sub
I want to handle a situation where one or both sheets are not found. I am getting a pop up with the error. How to get this error in a variable?
9 posts - 4 participants