PDA

View Full Version : MonthView DatePicker default to current date



KarlRadaza
05-17-2019, 07:46 AM
Hello gods of Excel Universe!https://www.mrexcel.com/forum/images/smilies/icon_cool.gif

I have been trying now for a month figuring this out but to no avail. Also i have searched the forums and found none related to my issue.

Basically in my userform,i just want my MonthView date picker to default to the current month/date, although i have the "Today" date displayed at the bottom of the monthview calendar, the actual month view is from the past and i'd really want the current one to show.

Apparently you cannot delete the date in "Value" property. It would not accept number zero as well or any word that i have tried my luck such as "Today" or "Now". Help please!

Thanks for your time!https://www.mrexcel.com/forum/images/smilies/icon_smile.gif

austenr
05-17-2019, 11:50 AM
Kindly post what you have tried. The workbook is preferable if it does not contain sensitive data.

KarlRadaza
05-21-2019, 12:13 AM
Kindly post what you have tried. The workbook is preferable if it does not contain sensitive data.

Sorry i have not posted details on the form, here it is:

24248

As you can see on the monthview, May1 is highlighted or in default. I wanted May21 to be the default which is the current date.
I tried deleting the input value in its property "Value" but it would not.

24249

This is the code i have for the MonthView:

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
On Error Resume Next
TextBox1.Value = DateClicked
Sheet1.Range("C3").Value = DateClicked
End Sub


Hope those details are sufficient.

大灰狼1976
05-21-2019, 01:25 AM
Hi KarlRadaza!
Not sure.

Private Sub UserForm_Initialize()
MonthView1.Value = Date
End Sub

Rob342
05-22-2019, 02:12 AM
which calender control are you using
Have tried it on MSCAL.OCX and everything works as it should !
Rob