Can anyone tell me why this works on the active sheet instead of the "Centre System Export" sheet?
With Worksheets("Centre System Export") .Unprotect ("passwd") Set rBottomCell = Cells(65536, 5) If IsEmpty(rBottomCell) Then Set rBottomCell = rBottomCell.End(xlUp) ' Cater for the scenario where the the worksheet contains no data. If rBottomCell.Rows.Row < 5 Then Exit Sub End If .Range("E5", Range("E5", rBottomCell).Offset(0, 29)).ClearContents .Protect ("passwd") End With
Bookmarks