Afficher dans combobox feuille visible

rebonjour

comment faire pour n'afficher dans mon combobox que les feuilles visible.

Voici mon code actuel.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "Form2017"
Dim plg As Range
Set plg = ActiveSheet.Cells(Rows.Count, 1).End(xlUp)(2)
plg = UserForm1.ComboBox2.Value
plg.Offset(, 1) = UserForm1.ComboBox3
plg.Offset(, 2) = UserForm1.CheckBox1

plg.Offset(, 8) = UserForm1.TextBox1
Range("A2") = ActiveSheet.Name
If ComboBox1.Text = "" Then
MsgBox ("vous n'avez pas choisi la Date, veuillez rectifier pour que ce soit pris en compte")
End If
ActiveSheet.Protect "Form2017"
ActiveWindow.SelectedSheets.Visible = False
Unload Me
End Sub
Private Sub ComboBox1_Click()
Dim Feuille As String
    Feuille = ComboBox1.Value
    Worksheets(Feuille).Select
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Sheets
    'If Sheets.Visible Then
    If ws.Name <> "Base" Then
        ComboBox1.AddItem ws.Name
        End If
    Next

End Sub

Merci de votre aide

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "Form2017"
Dim plg As Range
Set plg = ActiveSheet.Cells(Rows.Count, 1).End(xlUp)(2)
plg = UserForm1.ComboBox2.Value
plg.Offset(, 1) = UserForm1.ComboBox3
plg.Offset(, 2) = UserForm1.CheckBox1

plg.Offset(, 8) = UserForm1.TextBox1
Range("A2") = ActiveSheet.Name
If ComboBox1.Text = "" Then
MsgBox ("vous n'avez pas choisi la Date, veuillez rectifier pour que ce soit pris en compte")
End If
ActiveSheet.Protect "Form2017"
ActiveWindow.SelectedSheets.Visible = False
Unload Me
End Sub
Private Sub ComboBox1_Click()
Dim Feuille As String
    Feuille = ComboBox1.Value
    Worksheets(Feuille).Select
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Sheets
    'If Sheets.Visible Then
    If ws.Name <> "Base" And ws.Visible = xlSheetVisible Then
        ComboBox1.AddItem ws.Name
        End If
    Next

End Sub

Merci de ton aide.

Rechercher des sujets similaires à "afficher combobox feuille visible"