I'm trying to change the "selected" cell/range in a worksheet that is currently not the active worksheet after protecting/unprotecting the worksheet. My current solution is:
NonActiveWorksheet.Unprotect
Application.ScreenUpdating = False
Set CurrentWorksheet = ActiveSheet
NonActiveWorksheet.Activate
NonActiveWorksheet.Cells(1, 1).Select
CurrentWorksheet.Activate
Application.ScreenUpdating = True
If I unprotect (.Unprotect
) a previously protected worksheet the NonActiveWorksheet stays active (CurrentWorksheet.Activate
seems to have no effect). When I debug the code step by step it works. The other way around, protecting (.Protect
) a previously unprotected worksheet works fine as well.
Any idea why this is or how to solve it? My preferred solution would be to change the selected/highlighted cell/range on a non-active worksheet without activating it so I don't get into the problem in the first place.