Colorer listbox selon condition

SVP est-il possible de colorer des lignes dans listbox dans un userform selon une date d'échéance

Bonjour,

A priori non !

Tu peux par contre surligner les lignes correspondantes. Un exemple :

Private Sub UserForm_Initialize()

    Dim I As Integer

    ListBox1.ListStyle = fmListStyleOption
    ListBox1.MultiSelect = fmMultiSelectMulti

    For I = 1 To 20

        ListBox1.AddItem Format(Date + I, "dd/mm/yyyy")

    Next I

    For I = 0 To ListBox1.ListCount - 1

        If CDate(ListBox1.List(I)) >= CDate("05/10/2016") And CDate(ListBox1.List(I)) <= CDate("07/10/2016") Then

            ListBox1.Selected(I) = True

        End If

    Next I

End Sub

merci beaucoup

Rechercher des sujets similaires à "colorer listbox condition"