Consulting

Results 1 to 5 of 5

Thread: MonthView DatePicker default to current date

  1. #1

    MonthView DatePicker default to current date

    Hello gods of Excel Universe!

    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!

  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Kindly post what you have tried. The workbook is preferable if it does not contain sensitive data.
    Peace of mind is found in some of the strangest places.

  3. #3
    Quote Originally Posted by austenr View Post
    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:

    screenshot1.JPG

    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.

    screenshot1.JPG

    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.
    Attached Images Attached Images

  4. #4
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi KarlRadaza!
    Not sure.
    Private Sub UserForm_Initialize()
    MonthView1.Value = Date
    End Sub

  5. #5
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    which calender control are you using
    Have tried it on MSCAL.OCX and everything works as it should !
    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •