I did not test this but have included notes so you can
get the idea of how it is supposed to work. Copy it to
the Worksheet code module.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long, sh As Worksheet
sh = ActiveSheet
'find last row with data and assign variable
lr = lastRow = sh.Cells.Find(What:="*", After:=sh.Range("A1"), _
LookAt:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=False).Row
'Define the range for making entries
Set rng = sh.Range("A13:AB" & lr)
'make sure there is a value in the cell
If Not Intersect(Taget, rng) Is Nothing Then
'validate against value in row 12
If Target sh.Cells(12, Target.Column) Then
'notify user that value is too large
MsgBox "Exceeds Authorized Limit"
'remove the entry
Target = ""
Exit Sub
End If
End If
End Sub
"Mark" wrote in message
...
Hi,
I'm trying to create a way to validate a cell value, or score, when the
User
tabs off of the cell. The first possible cell that will receive a score
will
be C13 and there can be an indeterminate number of columns and rows,
however
I don't believe that scores will be entered beyond column AB nor past row
50.
The maximum possible score in each column is located in row 12
respectively
and I want to make sure that the score in each column does not exceed the
value in row 12. For example, column E (from row 13 downward) may contain
scores related to fractions aptitude with the maximum possible score of 10
in
cell E12. Currently, I'm using Excel's built in data validation feature,
but
some people have figured out how to get around it. Is there an event
procedure, or other process, that will do the validation process?
Thanks,
Mark
-----------------------------------------------------------------------------
Less Spam Better enjoyable experience
Visit :
news://spacesst.com