av8tordude
03-29-2011, 09:03 PM
I have 6 worksheets (Security, Master, Sheet1, Sheet2, Sheet3, f2106). I only want to display Master, Sheet1, Sheet2, Sheet3 in a combo box only.
Sheets Security & f2106 should not display in combo box. I found this code that displays all sheets except "master" in the combo box, but can't figure out how to edit it to fit my needs.
Dim Sh As Worksheet
With cboYear
.Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name <> "Master" Or Sh.Name <> "Security" Then
.AddItem Sh.Name
End If
Next
End With
Sheets Security & f2106 should not display in combo box. I found this code that displays all sheets except "master" in the combo box, but can't figure out how to edit it to fit my needs.
Dim Sh As Worksheet
With cboYear
.Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name <> "Master" Or Sh.Name <> "Security" Then
.AddItem Sh.Name
End If
Next
End With