Hi Everyone,
I hope you are all well.
I have a workbook with 14 sheets, twelve of them are the full months of a year, the other two are protected and hidden sheets.
I have the following code that populates all sheets in a combobox:
Option Explicit
Private Sub Userform_Initialize()
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
Me.lstSheets.AddItem sht.Name
Next sht
End Sub
What I need is to populate on the ComboBox (lstSheets) all sheets but the two I have protected and hidden. The sheets names are: "Database" and "Codes".
I've tried few codes, even with IF statement but cannot have it to work properly.
Any ideas will be highly appreciated.
Best regards,
Filipe
Bookmarks