我目前正在为 VBA 文件创建一个类对象,其目标是充当可以传递单个单元格的范围字典。如果此单元格包含在某个范围内,则它返回与相应范围键关联的值。类名称是“rangeDic”。
它正在制作中,因此其功能尚未实现。这是代码:
Private zone() As String
Private bounds() As String
Private link As Dictionary
Const ContextId = 33
'Init zone
Private Sub Class_Initialize()
Set link = New Dictionary
ReDim zone(0)
ReDim bounds(0)
End Sub
'properties
Property Get linkDico() As Dictionary
Set linkDico = link
End Property
Property Set linkDico(d As Dictionary)
Set link = d
End Property
Property Get pZone() As String()
pZone = zone
End Property
Property Let pZone(a() As String)
Let zone = a
End Property …Run Code Online (Sandbox Code Playgroud)