how to see locked cells

  • Thread starter Thread starter Nekro
  • Start date Start date
N

Nekro

i´d like to know how can i do to see (easily) whether a cell is locked
or not, when the workbook IS NOT protected, because using "format /
cells" for each one is a little messy


thanx a lot!!!!!
 
You can add a Lock Cell button to the toolbar:

Choose Tools>Customize
Select the Commands tab
Choose the Format category
In the list of command buttons, scroll almost to the bottom,
to find the Lock Cell button
Drag the Lock Cell button to the toolbar
Close the Customize window.

Select a cell, and lock/unlock the cell by clicking the Lock Cell button
 
Nekro

Sub Locked_Cells()
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.Select
End Sub

Gord Dibben Excel MVP
 
And to see if the cell is locked, you can just select the cell and look at that
icon.

If it looks pushed in, it's locked. If not pushed in, it's not locked.
 
One more option if you're not using conditional formatting.

select A1
then select all the cells (Ctrl-A is a quick way).
Then format|Conditional formatting
formula is
=CELL("protect",A1)

Give it a nice shaded pattern.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top