got a row across 12 cols.
need to find away so that once the sum of the row is = 19 (Cell O14), any blank cells are either locked/cleared.
have found this code but dont know how to adapt to fit what I need:
need to find away so that once the sum of the row is = 19 (Cell O14), any blank cells are either locked/cleared.
have found this code but dont know how to adapt to fit what I need:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If [O14] = "19" Then
[BLANK CELLS IN ROW].Interior.ColorIndex = 34
[BLANK CELLS IN ROW].ClearContents
Else
[BLANK CELLS IN ROW].Interior.ColorIndex = 0
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Address <> Target.Address Then Exit Sub
If Target.Address = "BLANK CELLS IN ROW" Then
If [O14] = "19" Then
[BLANK CELLS IN ROW].ClearContents
MsgBox "Sorry!" & vbCrLf & _
"ERROR MSG HERE", 64, "Access into cell not allowed."
End If
End If
End Sub