It definitely won't work if the sheet is protected when you run the code; otherwise, it should work fine as there is nothing wrong with the syntax.