Hi,
I've been struggling with this problem for awhile.
I've made a form out of ActiveX controls, vba codes etc.
I am almost zero knowledge about vba.
I've made a combo box, named cmbDate.
ListFillRange of the combo box is Q11:Q13, where there are formulas in this cells:
Q11: =TEXT(TODAY(),"dd/mm/yyyy")
Q12: =TEXT(TODAY()-1,"dd/mm/yyyy")
Q13: =TEXT(TODAY()+1,"dd/mm/yyyy")
Also, I have this code running in vba for this combo box:
What I want is, when a user start using the form, the combo box for date will have the Q11 value in there ready, because most of the time, a user will only use today's date, and occasionally tomorrow's or yesterday's.
So if the cmbDate can be default as today's date which is at Q11, and when he wants to change the value he can simply just press down the box and pick another date, it will be much user friendly.
I've tried:
But that will not give me option to change the value if I wanted to change, and when I press other dates in the box, it will still goes to 'today'.
Please advice me!
Thanks!
I've been struggling with this problem for awhile.
I've made a form out of ActiveX controls, vba codes etc.
I am almost zero knowledge about vba.
I've made a combo box, named cmbDate.
ListFillRange of the combo box is Q11:Q13, where there are formulas in this cells:
Q11: =TEXT(TODAY(),"dd/mm/yyyy")
Q12: =TEXT(TODAY()-1,"dd/mm/yyyy")
Q13: =TEXT(TODAY()+1,"dd/mm/yyyy")
Also, I have this code running in vba for this combo box:
Code:
Private Sub cmbDate_Change() ActiveSheet.cmbDate.Value = Format(ActiveSheet.cmbDate.Value, "dd/mm/yyyy")
End Sub
So if the cmbDate can be default as today's date which is at Q11, and when he wants to change the value he can simply just press down the box and pick another date, it will be much user friendly.
I've tried:
Code:
Private Sub cmbDate_Change() ActiveSheet.cmbDate.Value = Format(ActiveSheet.cmbDate.Value, "dd/mm/yyyy")
cmbDate.Value = cmbDate.List(0)
End Sub
Please advice me!
Thanks!