DateFin = CDbl(CDate(Me.TextBox2))
ColNom = CboTav.ListIndex + 4
NumMotif = CboMotif.ListIndex + 1
With Worksheets("TAV")
TxtFormat = .Range("C12").NumberFormat
.Range("C12:C377").NumberFormat = "General"
Set C = .Columns(3).Find(DateDebut, lookin:=xlValues)
If Not C Is Nothing Then
Ldebut = C.Row
End If
Set C = .Columns(3).Find(DateFin, lookin:=xlValues)
If Not C Is Nothing Then
Lfin = C.Row
End If
.Range("C12:C377").NumberFormat = TxtFormat
For L = Ldebut To Lfin
If .Cells(L, 2).Text = "lun" Then .Cells(L, ColNom) = NumMotif
If .Cells(L, 2).Text = "mar" Then .Cells(L, ColNom) = NumMotif
If .Cells(L, 2).Text = "mer" Then .Cells(L, ColNom) = NumMotif
If .Cells(L, 2).Text = "jeu" Then .Cells(L, ColNom) = NumMotif
If .Cells(L, 2).Text = "ven" Then .Cells(L, ColNom) = NumMotif
If .Cells(L, ColNom).Interior.ColorIndex = -4142 Then .Cells(L, ColNom).Interior.ColorIndex = .Cells(NumMotif, 2).Interior.ColorIndex
If TextBox3 <> "" Then
Cells(L, ColNom).Select
Selection.AddComment
Selection.Comment.Visible = False
Selection.Comment.Text Text:=TextBox3.Text & Chr(10) & ""
End If
Next L
End With
Unload UsfMenu
End Sub