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 37 38 39 40 41
|
Option Explicit
Dim Capteurs() As Collection
Dim Coef() As Variant
Dim Info() As Variant
Dim a As String
Dim i As Integer
Dim NbCapteurs As Long
Dim NbLignes As Long
Sub Test()
Sheets("BDD").Select
NbLignes = 11 'vite fait pour les tests !!!
NbCapteurs = 0
ReDim Coef(1 To NbLignes - 1)
ReDim Capteurs(1 To NbLignes - 1)
ReDim Info(1 To NbLignes - 1)
For i = 1 To NbLignes - 1
If Cells(i + 1, 1) <> Cells(i, 1) Then
NbCapteurs = NbCapteurs + 1
Set Capteurs(NbCapteurs) = New Collection
Set Info(NbCapteurs) = New ClsInfos
Info(NbCapteurs).ID = Cells(i + 1, 1)
Info(NbCapteurs).Marque = Cells(i + 1, 2)
Info(NbCapteurs).Modele = Cells(i + 1, 3)
Capteurs(NbCapteurs).Add Info(NbCapteurs)
End If
Set Coef(i) = New ClsCoefficient
Coef(i).DateEtal = Cells(i, 4)
Coef(i).Alpha = Cells(i, 5)
Coef(i).Beta = Cells(i, 6)
Coef(i).Linearite = Cells(i, 7)
Capteurs(NbCapteurs).Add Coef(i)
Next i
End Sub |
Partager