>>323
構造体でできなくはない
VBAの構造体、制限多いけどな

Public Type Rect
Top As Integer: Left As Integer: Bottom As Integer: Right As Integer
End Type
Public Function CRect(Top As Integer, Left As Integer, Bottom As Integer, Right As Integer) As Rect
Dim r As Rect
r.Top = Top: r.Left = Left: r.Bottom = Bottom: r.Right = Right
CRect = r
End Function
Public Function PtInRect(Rect As Rect, x As Integer, y As Integer) As Boolean
If Rect.Left < x And Rect.Right > x And Rect.Top < y And Rect.Bottom > y Then
PtInRect = True
End If
End Function
Public Sub test()
Dim r(10) As Rect
r(1) = CRect(10, 10, 100, 100) '...
If PtInRect(r(1), 15, 180) Then
MsgBox "In Rect1"
End If
If PtInRect(CRect(10, 10, 100, 100), 15, 80) Then
MsgBox "In Rect2"
End If
End Sub
改行多すぎらしいので:で詰めて書いてる