I have this code that greys out part of column D if column E is greyed out, and makes column E colored and vice versa.
Instead of making it grey, I would like to make the cells uneditable.
Is that possible?
Dim sourceCell1 As Range, targetRng1 As Range, sourceCell2 As Range, targetRng2
As Range
With Worksheets("SHELLY")
If .Range("D3:D19").Interior.ColorIndex = 15 Then
Set sourceCell1 = .Range("C41")
Set targetRng1 = .Range("F3:F19")
Set sourceCell2 = .Range("C42")
Set targetRng2 = .Range("D3:D19")
Else
Set sourceCell1 = .Range("C41")
Set targetRng1 = .Range("D3:F19")
Set sourceCell2 = .Range("C43")
Set targetRng2 = .Range("F3:F19")
End If
End With
sourceCell1.Copy
targetRng1.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
sourceCell2.Copy
targetRng2.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False