rdoulaghsingh
Board Regular
- Joined
- Feb 14, 2021
- Messages
- 105
- Office Version
- 365
- Platform
- Windows
I have a range of cells C3:C13 and C18:C28 with dropdown lists. What I'm trying to accomplish is...if the user drops down a value of "N/A", then the cell to immediate left is locked from being edited and the cell shaded. This is what I have so far in the worksheet_change event, but it doesn't seem to work.
Please help!
VBA Code:
Application.EnableEvents = False
If Target.Range("C3:C13") Or Target.Range ("C18:C28") Then
If Target = "N/A" Then
Target(0,1) = "(N/A)"
With Selection.Interior
.Pattern = xlLightDown
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Else
Exit Sub
End If
End If
Application.EnableEvents = True
Please help!