Ajouter valeur sous condition dans combobox

Bonjour à tous,

J'essaye d'ajouter des valeurs à ma combobox uniquement si celle-ci sont en grasse. Mais je bloque et je ne sais pas comment faire :/

Voici un essai de code :

Private Sub UserForm_Initialize()

Dim i As Integer, x As Integer
i = Sheets("Biblio").Range("A65536").End(xlUp).Row
For x = 3 To i
    With ComboBox1
        If Cells(x, 1).Font.Bold = True Then
        .AddItem Sheets("Biblio").Cells(x, 1).Value
        End If
    End With
Next x
End Sub

Merci à vous

bonjour,

essaie ainsi

Private Sub UserForm_Initialize()

Dim i As Integer, x As Integer
i = Sheets("Biblio").Range("A65536").End(xlUp).Row
For x = 3 To i
    With ComboBox1
        If Sheets("Biblio").Cells(x, 1).Font.Bold = True Then
        .AddItem Sheets("Biblio").Cells(x, 1).Value
        End If
    End With
Next x
End Sub

En effet j'en étais vraiment pas loin

Merci beaucoup!

Rechercher des sujets similaires à "ajouter valeur condition combobox"