PDA

View Full Version : Solved: Display following year in combo box



av8tordude
04-01-2011, 07:43 PM
I have sheet tabs that are named by the year (i.e. New Report, 2011, 2010 2009, etc). The code below displays the sheet tabs in the combo (which works fine). But, Instead of "New Report" being an option to select, I would like to display the next consecutive year. (i.e. 2012). Will someone assist. Thanks

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 Sh.Name
End If
Next
End With
EE = True
End Sub

av8tordude
04-01-2011, 08:40 PM
Disregard...

mdmackillop
04-02-2011, 02:51 AM
A comment for any readers:
Using only a number as a Sheet name 2011, 2012 can get confusing in coding. f2106 etc as shown above makes life easier.