ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   View Locked Cells (https://www.excelbanter.com/excel-programming/357863-view-locked-cells.html)

Darin Kramer

View Locked Cells
 
Howdie,

Is there a way to select all locked cells within a sheet?
Alternatively, could I produce a new sheet with all the references of
the locked cells...? (eg b1,c3,c9... etc would be all the locked
cells...)

Thanks

D :)



*** Sent via Developersdex http://www.developersdex.com ***

Vasant Nanavati

View Locked Cells
 
A small macro should do it. Something like:

Sub SelectLockedCells()
Dim c As Range, rng As Range
For Each c In ActiveSheet.UsedRange.Cells
If c.Locked Then
If rng Is Nothing Then
Set rng = c
Else
Set rng = Union(c, rng)
End If
End If
Next
rng.Select
End Sub



"Darin Kramer" wrote in message
...
Howdie,

Is there a way to select all locked cells within a sheet?
Alternatively, could I produce a new sheet with all the references of
the locked cells...? (eg b1,c3,c9... etc would be all the locked
cells...)

Thanks

D :)



*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com