Sub gerer()
Application.ScreenUpdating = False
Dim FL1 As Worksheet
Dim FL2 As Worksheet
Dim dat(13) As String
Dim pos(13) As Integer
Dim i As Integer
Dim jour As Integer
Dim mois As Integer
Dim l As Integer
Dim k As Integer
Dim nb As Integer
Dim h As Integer
Dim w As Integer
Dim datecir As String
Set FL1 = Worksheets(1)
Set FL2 = Worksheets(2)
ann2 = FL1.Cells(1, 3).Value
ann1 = ann2 - 1
dat(1) = "12/" & ann1
dat(2) = "01/" & ann2
dat(3) = "02/" & ann2
dat(4) = "03/" & ann2
dat(5) = "04/" & ann2
dat(6) = "05/" & ann2
dat(7) = "06/" & ann2
dat(8) = "07/" & ann2
dat(9) = "08/" & ann2
dat(10) = "09/" & ann2
dat(11) = "10/" & ann2
dat(12) = "11/" & ann2
dat(13) = "12/" & ann2
i = 1
For j = 34 To FL1.Cells(6, Columns.Count).End(xlToLeft).MergeArea.Offset(0, 1).Column - 1
If (FL1.Cells(6, j).Value Like "1") Then
pos(i) = j
i = i + 1
End If
Next j
'traitement principal
nb = 9
For NoLig = 8 To Split(FL1.UsedRange.Address, "$")(4)
w = NoLig
k = 0
For j = 34 To FL1.Cells(6, Columns.Count).End(xlToLeft).MergeArea.Offset(0, 1).Column - 1
If (FL1.Cells(NoLig, j) <> "") Then
k = k + 1
End If
Next j
For j = 34 To FL1.Cells(6, Columns.Count).End(xlToLeft).MergeArea.Offset(0, 1).Column - 1
If (FL1.Cells(NoLig, j) <> "") Then
jour = FL1.Cells(6, j)
l = j
mois = posmois(l, jour)
'on a former une date
da = datecirculation(mois, dat(), pos())
If ((jour Like "1") Or (jour Like "2") Or (jour Like "3") Or (jour Like "4") Or (jour Like "5") Or (jour Like "6") Or (jour Like "7") Or (jour Like "8") Or (jour Like "9")) Then
datecir = "0" & jour & "/" & da
Else
datecir = jour & "/" & da
End If
End If
Next j
'si la date d'ouverture egale a la date dans le calendrier alors supprime la date
For nb = 9 To Split(FL2.UsedRange.Address, "$")(4)
If da Like Cells(nb, 12) Then
Cells(NoLig, j) = ""
End If
Next nb
Next NoLig
Application.ScreenUpdating = True
End Sub