Re : mise en couleur textbox Date sous condition
Merci bruno45 pour ta réponse
est il possible de différencier les textbox par un TAG pour appliquer ta solution en fonction d'un TAG
ex: si TAG "5ans" alors uniquement les textbox TAG "5ans" appliquent ta solution pour 5ans
Si TAG "3ans" alors.......... ta solution pour 3ans
Etc......
j'ai un grand nombres de textbox et souhaite les différencier par un TAG
personnellement j'avais commencé à travailler sur chaque textbox individuellement:
If IsDate(TextBox1.Value) Then
If DateAdd("yyyy", 5, CDate(TextBox1.Value)) > DateAdd("m", -2, Date) And _
DateAdd("yyyy", 3, CDate(TextBox1.Value)) < Format(Now(), "dd/mm/yyyy") Then
TextBox1.BackColor = vbYellow
End If
If DateAdd("yyyy", 5, CDate(TextBox1.Value)) >= Date Then
TextBox1.BackColor = vbRed
End If
End If
TextBox2.Value = Sheets("Feuil1").Range("A3").Value
Mais c'était pas la bonne solution. L'idéal étant une boucle comme ta solution
Merci pour votre aide