locked cells

M

MillyMollyMandy

I've heard there is a way of displaying which cells are
locked, a bit like showing the formulas.

I need to do this to provide a printout to prove that the
cells are protected.

Does anyone know how to do it?
 
T

Tom Ogilvy

for each cell in ActiveSheet.Usedrange
if cell.locked = False then
cell.Interior.ColorIndex = 6
end if
Next
activesheet.printout
for each cell in ActiveSheet.Usedrange
if cell.locked = False then
cell.Interior.ColorIndex = xlNone
end if
Next

If you sheet doesn't have colors then the above might work.

an easier way might be to execute

Sub SetState()
Activesheet.EnableSelection = xlUnlockedCells
End Sub

then when protection is in effect, only the unlocked cells can be selected.
 
Top