Option Explicit
Sub Test()
Dim Dic As New Dictionary
CSR(Dic, 32767, 32767) = 123.45
MsgBox CSR(Dic, 32767, 32767)
End Sub
Property Let CSR(ByVal Dic As Dictionary, ByVal X As Integer, ByVal Y As Integer, ByVal Val As Double)
Dim Clé As Long
Clé = &H10000 * X + Y
If Val <> 0 Then
Dic(Clé) = Val
ElseIf Dic.Exists(Clé) Then
Dic.Remove Clé
End If
End Property
Property Get CSR(ByVal Dic As Dictionary, ByVal X As Integer, ByVal Y As Integer) As Double
Dim Clé As Long
Clé = &H10000 * X + Y
If Dic.Exists(Clé) Then CSR = Dic(Clé)
End Property