Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I have sheet tabs name by the year. Only 1 sheet tab will be visible. All other tabs will be hidden. The code below will populate the userform with years (i.e. 2019, 2018, 2017, etc). My current sheet tab (2018) is visible. I would like the combo box to not display the year in the combo box of the visible sheet (2018). (i.e. If sheet tab 2018 is visible, the dropdown should only display 2019, 2017, 2016). Is this possible?
Thanks for you help
Thanks for you help
Code:
Dim iloop as interger
With cboYear For iloop = Year(Date) - 2 To Year(Date) + 1 Step 1
.AddItem iloop
Next
End With