Revision 663061346233 () - Diff

Link to this snippet: https://friendpaste.com/3DWujWgX971XCJpTHA1aqC
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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