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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
Function scan(Page)
Dim C2 As Byte
Dim L2 As Byte
Dim nature(50, 50)
Dim C As Long
Dim L As Long
Dim CRescue As Byte
Dim Total As Byte
Total = 1
C2 = 0
L2 = 0
For x = 0 To 50
nature(x, Total) = 0
Next x
For C = 1 To 40
For L = 1 To 100
If VarType(Cells(L, C).Value) = 8 Then ' Verifie si le type de la variable est un string
For i = 0 To 50
If Cells(L, C).Value Like nature(C2 + i, L2) Then ' Scan la ligne et enregistre le chiffre qui correspond en l'enregistrant et en l'additionnant au précédent
CRescue = C
While VarType(Cells(L, C).Value) = 8 Or 0
If C < 25 Then
C = C + 1
End If
Wend
If VarType(Cells(L, C).Value) = 5 Then
nature(C2 + i, Total) = nature(C2 + i, Total) + Cells(L, C).Value
C = CRescue
Exit For
Else
Exit For
End If
Exit For
End If
If VarType(nature(C2 + i, L2)) = 0 Then 'Enregistre le nom inconnue et enregistre le total
CRescue = C
While VarType(Cells(L, C).Value) = 0 Or 8
If C < 25 Then
C = C + 1
End If
Wend
If VarType(Cells(L, C).Value) = 5 Then
nature(C2 + i, Total) = nature(C2 + i, Total) + Cells(L, C).Value
C = CRescue
nature(C2 + i, L2) = Cells(L, C).Value
Exit For
Else
Exit For
End If
Exit For
End If
Next i
End If
Next L
L = 1
Next C
End Function |
Partager