Private Sub UserForm_Initialize()
Dim L As Integer, TDon(), M As Integer, J As Integer, Lab As MSForms.Label, TBx As MSForms.TextBox, I As Integer
TDon = Feuil1.[A2].Resize(366, 2).Value
For L = 1 To DateSerial(Year(TDon(1, 1)) + 1, 1, 1) - TDon(1, 1)
M = Month(TDon(L, 1)): J = Day(TDon(L, 1))
Set Lab = Me("Label" & L)
Set TBx = Me("TextBox" & L)
Lab.Caption = J
TBx.Text = TDon(L, 2)
Lab.Left = 18 + (M - 1) * 84: Lab.Width = 12: Lab.Top = 25.5 + (J - 1) * 18: Lab.Height = 12
TBx.Left = 33 + (M - 1) * 84: TBx.Width = 36: TBx.Top = 24 + (J - 1) * 18: TBx.Height = 15
Select Case TDon(L, 2)
Case "M": TBx.BackColor = RGB(242, 8, 132)
Case "S": TBx.BackColor = RGB(0, 204, 255)
Case "N": TBx.BackColor = RGB(31, 183, 20)
Case "J": TBx.BackColor = RGB(255, 215, 45)
Case "REM": TBx.BackColor = RGB(240, 255, 45)
Case "CP": TBx.BackColor = RGB(255, 153, 0) 'ou 255.102.0
Case "CPN": TBx.BackColor = RGB(255, 153, 0) 'ou 255.102.0
Case "EF": TBx.BackColor = RGB(255, 153, 204)
Case "EFN": TBx.BackColor = RGB(255, 153, 204)
Case "AM": TBx.BackColor = RGB(255, 0, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "JCN": TBx.BackColor = RGB(153, 204, 0)
Case "HAR": TBx.BackColor = RGB(204, 204, 255)
Case "RSU": TBx.BackColor = RGB(255, 204, 153)
Case "REC": TBx.BackColor = RGB(255, 255, 255)
Case "GRV": TBx.BackColor = RGB(153, 102, 51)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "FOS": TBx.BackColor = RGB(164, 82, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "FOSN": TBx.BackColor = RGB(164, 82, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "DEL": TBx.BackColor = RGB(164, 82, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "DELN": TBx.BackColor = RGB(164, 82, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "ACTP": TBx.BackColor = RGB(0, 0, 0)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
Case "AAN": TBx.BackColor = RGB(166, 166, 166)
TBx.ForeColor = &HFFFFFF: TBx.Font.Bold = True
End Select
Next L
Label366.Visible = L > 366: TextBox366.Visible = L > 366
End Sub