Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I have this code that displays the sheet tab names in a combo box. How do I add the name "New Report" in the combo box and display it at the top of the list in the combo box? (Note: there is not sheet named New Report)
i.e.
New Report
Yr '2010
Yr '2011
i.e.
New Report
Yr '2010
Yr '2011
Code:
Private Sub cboYear_Enter()
Dim Sh As Worksheet
If EE Then Exit Sub
EE = False
With cboYear
For Each Sh In ActiveWorkbook.Sheets
If ((Sh.Name <> "Security") And (Sh.Name <> "f2106")) Then
.AddItem "Yr '" & Sh.Name
End If
Next
End With
EE = True
End Sub