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
| Public dicReg As Object
Sub test()
MsgBox TblChaîne(10, 1)
Dim k, i As Integer
k = dicReg.Keys
For i = 0 To dicReg.Count - 1
Debug.Print k(i), dicReg(k(i))
Next
End Sub
Property Get TblChaîne(L As Integer, C As Integer) As Variant
If TypeName(dicReg) = "Nothing" Then
Set dicReg = CreateObject("Scripting.Dictionary")
initialisation
End If
TblChaîne = dicReg(L & "_" & C)
End Property
Property Let TblChaîne(L As Integer, C As Integer, Value As Variant)
If TypeName(dicReg) = "Nothing" Then
Set dicReg = CreateObject("Scripting.Dictionary")
initialisation
End If
dicReg(L & "_" & C) = Value
End Property
Sub initialisation()
Dim L As Integer, C As Integer
For L = 1 To 20
For C = 0 To 5
TblChaîne(L, C + 1) = Format(L, "00") & AA(C)
Next
Next
End Sub
Function AA(i As Integer) As String
AA = Chr(65 + i) & Chr(65 + i)
End Function |
Partager