Hi Guys...
i am trying to put a control on the Date format which the user should enter...
Since i do not see an easy way with one text box, i thought i could create three combo boxes..
One with only Days dropdown, second with Month dropdown and third with Year...
To combine these three box selections i am using the code below
The problem occurs if a month like February falls to this entry, they are still able to select the days like 31st or 30th
I want a way to disable those days in this selection according to the last day of the month...
There is another code looking up for the date in this cell and if the user enters a wrong value then its going to be bad..
Thank you so much for reading this and helping me out..
AK
i am trying to put a control on the Date format which the user should enter...
Since i do not see an easy way with one text box, i thought i could create three combo boxes..
One with only Days dropdown, second with Month dropdown and third with Year...
Code:
ComboBox1.List = Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31")
ComboBox2.List = Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12")
ComboBox2.List = Array("2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030")
To combine these three box selections i am using the code below
Code:
DD = ComboBox1.Value
MM = ComboBox2.Value
YY = ComboBox2.Value
ExpiDate = DD & "/" & MM & "/" & YY
ActiveCell.Value = ExpiDate 'agreement Expiry date
The problem occurs if a month like February falls to this entry, they are still able to select the days like 31st or 30th
I want a way to disable those days in this selection according to the last day of the month...
There is another code looking up for the date in this cell and if the user enters a wrong value then its going to be bad..
Thank you so much for reading this and helping me out..
AK