Chiznuggets
New Member
- Joined
- Jun 26, 2019
- Messages
- 8
Hello,
I'm creating a User Form and trying to get the starting position of a Combo Box to be the number of the month. For example since it is currently July I would like the Combo Box to start on position 6.
When I try this
All the variables except boxDate.SelStart acquire the desired value when I step through the program. It is staying as a value of 0 while the lngStart is a 6. Any ideas? I have all this code in the Userform under the initialize section.
I'm creating a User Form and trying to get the starting position of a Combo Box to be the number of the month. For example since it is currently July I would like the Combo Box to start on position 6.
When I try this
Code:
varToday = Date
varToday = varToday - 10 'this is purposeful
varToday = Format(varToday, "mm-dd-yy")
lngStart = Month(varToday)
boxDate.SelStart = lngStart - 1
All the variables except boxDate.SelStart acquire the desired value when I step through the program. It is staying as a value of 0 while the lngStart is a 6. Any ideas? I have all this code in the Userform under the initialize section.