View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Viewing of protected locked or unlocked cells

To color locked cells.

Sub Locked_Cells()
'Bob Flanagan source of code
Dim Cell As Range, tempR As Range, rangeToCheck As Range
'check each cell in the selection
For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
If Cell.Locked Then
If tempR Is Nothing Then
'initialize tempR with the first qualifying cell
Set tempR = Cell
Else
'add additional cells to tempR
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
'display message and stop if no cells found
If tempR Is Nothing Then
MsgBox "There are no Locked cells " & _
"in the selected range."
End
End If
'select qualifying cells
tempR.Interior.ColorIndex = 3
End Sub


Gord Dibben MS Excel MVP

On Tue, 21 Apr 2009 06:52:01 -0700, jmisenar
wrote:

Is there a way to view an entire workshees to see which cells are locked and
unlocked?