Lock/Delete cells in row once the total sum is 19

dubaifly

New Member
Joined
Jan 30, 2009
Messages
10
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:

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
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
i know im probably being really impatient but can anyone help on this or point me to a good source?

Tks.
 
Upvote 0

Forum statistics

Threads
1,203,506
Messages
6,055,807
Members
444,826
Latest member
aggerdanny

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top