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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| Sub TRITAB()
'1ere Partie du Tri'
Dim TableauInit() As Variant
Dim i, j, k1, k2, k3, NbLignes, NbColonnes As Integer
Dim buffer() As Variant
Dim TableauTri1() As Variant
Dim TableauTri2() As Variant
Dim TableauTri3() As Variant
Dim TableauTri4() As Variant
Dim temp1, temp2, temp3 As String
Dim Taille_t1 As Integer, Taille_t2 As Integer, Taille_t3 As Integer
TableauInit = Range("A:G").Formula
temp1 = "Error"
temp2 = "Warning"
temp3 = "Information"
k1 = "0"
k2 = "0"
k3 = "0"
NbColonnes = "7"
NbLignes = "1044"
ReDim TableauTri1(1 To NbLignes, 1 To NbColonnes)
ReDim TableauTri2(1 To NbLignes, 1 To NbColonnes)
ReDim TableauTri3(1 To NbLignes, 1 To NbColonnes)
For i = 1 To NbLignes
If ((TableauInit(i, 1)) = temp1) Then
buffer = TableauInit(i, 1)
TableauTri1(k1, j) = buffer
i = i + 1
k1 = k1 + 1
End If
If ((TableauInit(1, 1)) = temp2) Then
TableauInit(i, 1) = TableauTri2(k2, j)
i = i + 1
k2 = k2 + 1
End If
If ((TableauInit(i, 1)) = temp3) Then
buffer = TableauInit(i, 1)
TableauTri3(k3, j) = buffer
i = i + 1
k3 = k3 + 1
End If
Taille_t1 = UBound(TableauTri1)
Taille_t2 = UBound(TableauTri2)
Taille_t3 = UBound(TableauTri3)
Taille = Taille_t1 + Taille_t2 + Taille_t3
ReDim TableauTri4(1 To Taille, 1 To NbColonnes)
k2 = "1"
k3 = "1"
TableauTri4 = TableauTri1
'For w = 1 To Taille_t2
'TableauTri4(Taille_t1+w) = TableauTri2(w)
'Next w '
'For Y = 1 To Taille_t3'
'TableauTri4(Taille_t1+Taille_t2 + Y, k3) = TableauTri3(Y, k3)'
'Next Y'
Next i
Sheets.Add.Name = "Tri10"
Sheets("Tri1").Range("A:G").Formula = TableauTri4
End Sub |
Partager