Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting only locked cells
Hi
I want to be able to set a range variable equal to the cells in a Worksheet which are locked. I will be using visual basic code. I have looked at xlspecialcells but with no luck. Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting only locked cells
Might be another way but:
Dim rng As Range Set rng = ActiveSheet.UsedRange Dim rngLockedCells As Range Dim cell As Range For Each cell In rng If cell.Locked = True Then If rngLockedCells Is Nothing Then Set rngLockedCells = cell Else Set rngLockedCells = Union(rngLockedCells, cell) End If End If Next rngLockedCells.Select HTH. -Brad -----Original Message----- Hi I want to be able to set a range variable equal to the cells in a Worksheet which are locked. I will be using visual basic code. I have looked at xlspecialcells but with no luck. Tim . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting only locked cells
Hi Tim,
Thanks for participating in the community! From my understanding to this issue, you are going to obtain one range object which points to these locked cells in your workbook. So far as I know, the method from Brad is the solution in this scenario. From Excel object, there is no one method for us to pick up these locked cells directly. If you have any further question regarding this, please feel free to let me know. Enjoy a nice weekend! Wei-Dong Xu Microsoft Product Support Services Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cursor selecting cells locked on... | Excel Discussion (Misc queries) | |||
Locked worksheet & hyperlinks (w/ select locked cells unchecked) | Excel Discussion (Misc queries) | |||
What to do if the worksheet is locked on selecting rows or cells? | Excel Discussion (Misc queries) | |||
paste locked cells and unlocked cells in protected sheet | Excel Worksheet Functions | |||
Put comments on a locked spreadsheet even though cells not locked | Excel Worksheet Functions |