ScottInTexas
Board Regular
- Joined
- Oct 28, 2003
- Messages
- 178
I have a zillion named ranges and I need to go through the list and lock them. But I am getting an error "Unable to set the locked property of the Range class." Suppose the range is named LockMe1 then I am trying to do
Putting this in a loop and cycling through all the Names in the Application should allow me to lock all the ranges I am interested in rather than go through several hundred ranges.
But I get that error.
Code:
Range("LockMe1").Locked=true
Putting this in a loop and cycling through all the Names in the Application should allow me to lock all the ranges I am interested in rather than go through several hundred ranges.
Code:
For each n in Application.Names
If Range(n.Name).Interior.Color=12343456 then
Range(n.Name).Locked=True
End If
Next
But I get that error.