Based on some kind of Googling, this is an example of a search problem in a two-dimensional point application, or "stabbing problem." Cm:
http://www.cs.nthu.edu.tw/~wkhon/ds/ds10/tutorial/tutorial6.pdf
here (starting on p. 21/52):
http://www.cs.brown.edu/courses/cs252/misc/slides/orthsearch.pdf
The key data structure is the segment tree:
http://en.wikipedia.org/wiki/Segment_tree
For the 2-D case, it looks like you can build a segment tree containing segment trees and get O (log ^ 2 (n)) query complexity. (I think your current solution is O (n), because on average you simply exclude half of your regions using binary search.)
" ", , , , . , . "", , , , .
, , - -, , Excel/VBA , O (1 ) :
Public Sub brutishButShort()
Dim posns(1 To 65536, 1 To 256) As Collection
Dim regions As Collection
Set regions = New Collection
Call regions.Add([q42:z99])
Call regions.Add([a1:s100])
Call regions.Add([r45])
Dim rng As Range
Dim cell As Range
Dim r As Long
Dim c As Long
For Each rng In regions
For Each cell In rng
r = cell.Row
c = cell.Column
If posns(r, c) Is Nothing Then
Set posns(r, c) = New Collection
End If
Call posns(r, c).Add(rng)
Next cell
Next rng
Dim query As Range
Set query = [r45]
If Not posns(query.Row, query.Column) Is Nothing Then
Dim result As Range
For Each result In posns(query.Row, query.Column)
Debug.Print result.address
Next result
End If
End Sub
, , , D-D. , , .