--- Revision None +++ Revision 663061346233 @@ -0,0 +1,41 @@ +Option Explicit + +Function IsInter(r As Range, t As Range) As Boolean + Dim first As Range + Set first = r + + Dim last As Range + Set last = r.Cells(r.Count) + + If first.Row <= t.Row Then + If t.Row <= last.Row Then + If first.Column <= t.Column Then + If t.Column <= last.Column Then + IsInter = True + Exit Function + End If + End If + End If + End If + IsInter = False +End Function + +Private Sub Worksheet_Change(ByVal Target As Range) + If IsInter(Range("A1:A10"), Target) Then + If Target.Value <= 5 Then + Call MsgBox("min") + End If + End If + + If IsInter(Range("A11:A15"), Target) Then + If Target.Value <= 10 Then + Call MsgBox("min") + End If + End If + + If IsInter(Range("B1:B15"), Target) Then + If Target.Value <= 3 Then + Call MsgBox("min") + End If + End If +End Sub