|
|
|
|
|
|
Excel
|
Hightlight all protected cells
|
|
Ease of Use
|
Easy
|
Version tested with
|
97
|
Submitted by:
|
Steiner
|
Description:
|
A simple macro to highlight all protected cells on a worksheet.
|
Discussion:
|
Sometimes you get a new workbook from a colleague where it's not obvious which cells are locked and you don't like to find that out by trial and error.
WARNING! As this macro uses the interior color to highlight the cells, I'd advise you to use it on a copy of the worksheet in question because all other colorings will be lost.
|
Code:
|
instructions for use
|
Sub HightlightProtected()
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange
If rCell.Locked = True Then
rCell.Interior.ColorIndex = 36
Else
rCell.Interior.ColorIndex = xlNone
End If
Next rCell
End Sub
|
How to use:
|
- create a copy of the worksheet you want to check (see discussion above)
- open the VBA-Editor (Alt + F11)
- insert a new module and copy & paste the code there
- go back to Excel and select the worksheet you want to process
- run the code
|
Test the code:
|
- download the sample and run it
|
Sample File:
|
Highlight.zip 9.06KB
|
Approved by mdmackillop
|
This entry has been viewed 204 times.
|
|