Spurious Claim
New Member
- Joined
- Mar 6, 2018
- Messages
- 2
I have been using the following code which I got off another thread. The code works well if I manually enter the contents in column 'N', however my spreadsheet populates column 'N' from a SUMIF formula which seems to bypass the code.
DATA VALIDATION doesn't seem to work either (=SUM($H37-$N37)>0).
Any help on this would be much appreciated
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
Dim rngN As Range, rngH As Range
Set rngN = Application.Intersect(Target.EntireRow, Range("N1").EntireColumn)
Set rngH = Application.Intersect(Target.EntireRow, Range("H1").EntireColumn)
If rngN.Value > rngH.Value Then
MsgBox ("EXPENDITURE EXCEEDS LETTING")
Target.Value = ""
End If
End If
End Sub
DATA VALIDATION doesn't seem to work either (=SUM($H37-$N37)>0).
Any help on this would be much appreciated
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
Dim rngN As Range, rngH As Range
Set rngN = Application.Intersect(Target.EntireRow, Range("N1").EntireColumn)
Set rngH = Application.Intersect(Target.EntireRow, Range("H1").EntireColumn)
If rngN.Value > rngH.Value Then
MsgBox ("EXPENDITURE EXCEEDS LETTING")
Target.Value = ""
End If
End If
End Sub