Private Sub Worksheet_Activate()
ActiveSheet.Range("A9:AF65536").ClearContents
ActiveSheet.Range("A9:AF65536").Interior.ColorIndex = xlNone
[B][COLOR=Blue]Application.Calculation = xlCalculationManual
Application.ScreenUpdating = 0[/COLOR][/B]
Dim ligne As Integer
Dim n As Integer
Dim m As Integer
Dim coll As Collection
Set coll = New Collection
For n = 2 To Sheets("BD_Absence").Range("A65536").End(xlUp).Row
On Error Resume Next
coll.Add Trim(Sheets("BD_Absence").Range("A" & n)), CStr(Trim(Sheets("BD_Absence").Range("A" & n)))
On Error GoTo 0
Next n
For n = 1 To coll.Count
ActiveSheet.Range("A" & n + 8) = coll(n)
Next n
tablo = Sheets("BD_Absence").Range("A2:E" & Sheets("BD_Absence").Range("A65536").End(xlUp).Row)
For n = LBound(tablo, 1) To UBound(tablo, 1)
Set c = ActiveSheet.Columns(1).Find(Trim(tablo(n, 1)), LookIn:=xlValues, lookat:=xlWhole)
ligne = c.Row
Set d = Sheets("BD_Absence").Range("L2:L" & Sheets("BD_Absence").Range("L65536").End(xlUp).Row).Find(tablo(n, 5), LookIn:=xlValues, lookat:=xlWhole)
For m = 2 To 32
If ActiveSheet.Cells(6, m) >= Day(tablo(n, 3)) And ActiveSheet.Cells(6, m) <= Day(tablo(n, 4)) Then
ActiveSheet.Cells(ligne, m) = 1
If Not d Is Nothing Then
ActiveSheet.Cells(ligne, m).Interior.ColorIndex = d.Interior.ColorIndex
ActiveSheet.Cells(ligne, m).Font.Size = 12
ActiveSheet.Cells(ligne, m).Font.Bold = True
ActiveSheet.Cells(ligne, m).HorizontalAlignment = xlCenter
End If
End If
Next m
Next n
[B][COLOR=Blue]Application.Calculation = xlCalculationAutomatic[/COLOR][/B]
End Sub