ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
I am using the code below on my userform
When i open the userform for this month code i currently see 2023
If i then click the drop down arrow i then see,
2022
2023
2024
2025
2026
Please advise how i see 2023 when i open the userform BUT when i click the drop down arrow i then see the current year followed by years to come.
There is no need for me to see previous years thus,
2023
2024
2025
2026
I have tried to change a few values but unable to see what i require
Thanks
When i open the userform for this month code i currently see 2023
If i then click the drop down arrow i then see,
2022
2023
2024
2025
2026
Please advise how i see 2023 when i open the userform BUT when i click the drop down arrow i then see the current year followed by years to come.
There is no need for me to see previous years thus,
2023
2024
2025
2026
Rich (BB code):
Private Sub UserForm_Initialize()
With Me
With .cboYear
.Clear
'change the number to adjust years shown
For i = -1 To 3
.AddItem (Format(Date, "YYYY")) + i
Next
.ListIndex = 1
End With
With .cboMonth
.Clear
.List = Application.GetCustomListContents(4)
.ListIndex = Month(Date) - 1
L = .ListIndex
End With
End With
loadDays
Me.StartUpPosition = 0
Me.Top = Application.Top + 300 ' MARGIN FROM TOP OF SCREEN
Me.Left = Application.Left + Application.Width - Me.Width - 220 ' LEFT / RIGHT OF SCREEN
End Sub
I have tried to change a few values but unable to see what i require
Thanks