Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've adapted some code I found on this group to protect rows that have
text in column A. Here is the code which runs on the Save event: Dim i As Integer ActiveSheet.Unprotect For i = 1 To Range("A65536").End(xlUp).Row If Cells(i, 1).Value < "" Then Cells(i, 1).EntireRow.Locked = True Else Cells(i, 1).EntireRow.Locked = False End If Next i ActiveSheet.Protect Interestingly I discovered that when I only had one row of information not only was that row protected but also all the rows below it. However when I inserted an additional row both rows with text in column A were protected but other rows could be edited as originally intended. Can anyone explain why this is happening. It took me some while to fathom. Many thanks in anticipation Simon |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect and lock cell in Pivottable | Excel Worksheet Functions | |||
how to only protect/lock cell formats? | Excel Discussion (Misc queries) | |||
Protect or Lock Column | Excel Programming | |||
Lock and protect cells without protect the sheet | Excel Programming | |||
Protect and Lock Problem SOLVED!! | Excel Programming |