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
| Public Sub matima()
Dim i As Integer
Dim j As Integer
Dim ligne As Long
Dim colonne As Long
Dim tablo() As Variant
Application.DisplayAlerts = False
Application.ScreenUpdating = False
colonne = Cells(8, Columns.Count).End(xlToLeft).Column
ligne = Sheets("Effectif Niveaux").Cells(Rows.Count, 1).End(xlUp).Row
ReDim tablo(1 To ligne - 8, 1 To colonne - 6)
'Ici on calcule la table d'addition en la stockant dans notre tableau
For i = 1 To UBound(tablo, 1)
For j = 1 To UBound(tablo, 2)
If Evaluate("INDIRECT(""'Competence Effectif'!""&ADDRESS(MATCH('Effectif Niveaux'!$E" & i + 8 & ",'Competence Effectif'!$E1:$E" & ligne & ",0),MATCH('Effectif Niveaux'!" & Split(Cells(1, j + 6).Address, "$")(1) & "$8,'Competence Effectif'!$8:$8,0)))") Like "OUI" Then
tablo(i, j) = "Niv 0 / Intégration"
Else
tablo(i, j) = ""
End If
Next j
Next i
Sheets("Effectif Niveaux").Range("G9:" & Split(Cells(1, 380).Address, "$")(1) & ligne).Value = tablo
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub |