R
rob nobel
I need to lock columns C depending on whether Col M has a value in it.
The following is my attempt, but it's lacking somewhat.
I believe what I have will only work if the cells in col M should show true
or false but the cells in Col M have a $ value or nil value.
Public Sub LockIncomeCells()
On Error GoTo Oops
Dim Cell As Range
Sheet6.Unprotect
For Each Cell In Sheet6.Range("M5:M29")
With Cell
.Offset(0, -10).Resize(1, 2).Locked = .Value 'LOCK name &
Code
End With
Next Cell
Oops:
Sheet6.Protect
End Sub
Furthermore, as an alternative, is it possible to lock all cells (on
sheet6), in a range C5:L29, that are a particular colour (Red)?
Thank You,
Rob
The following is my attempt, but it's lacking somewhat.
I believe what I have will only work if the cells in col M should show true
or false but the cells in Col M have a $ value or nil value.
Public Sub LockIncomeCells()
On Error GoTo Oops
Dim Cell As Range
Sheet6.Unprotect
For Each Cell In Sheet6.Range("M5:M29")
With Cell
.Offset(0, -10).Resize(1, 2).Locked = .Value 'LOCK name &
Code
End With
Next Cell
Oops:
Sheet6.Protect
End Sub
Furthermore, as an alternative, is it possible to lock all cells (on
sheet6), in a range C5:L29, that are a particular colour (Red)?
Thank You,
Rob