Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am using this code:
To populate a range of cells with default values when a vlookup condition is met. If the condition is met, values are placed in the cells, the font colour changes, and the cells are supposed to lock preventing user access.
The worksheet is protected, however, I cannot get these cells to lock. Any ideas?
Code:
If Application.VLookup(FacB, wshfac.Range("A:H"), 6, False) = "N" Then 'no lights
.Range("AB24, AB26, AB25, AB27").Value = ""
.Range("AC24, AC26").Value = "NA"
With .Range("AB24:AE27")
.Font.Color = RGB(224, 224, 224)
.Locked = True
End With
Else 'has lights
To populate a range of cells with default values when a vlookup condition is met. If the condition is met, values are placed in the cells, the font colour changes, and the cells are supposed to lock preventing user access.
The worksheet is protected, however, I cannot get these cells to lock. Any ideas?