Solved

Excel 2007 and Calender Control

Posted on 2011-02-13
4
512 Views
Last Modified: 2012-06-22
Hi all

In Excel 2007 I am building an Input form.  On the input form I have inserted a Calender Control (12.0) that the user will select a date from.  In the Properties of that Calender Control I have linked it to cell C6 of my form.  However, the "Value" always comes up with either "Null" as date selected or a hard keyed date.  Is there a way to default the Calender Control date to Date() or Today().  I've tried both and it doesn't save.  It appears I can set the Calender Control Properties "ValueIsNull" to either True or False.  However if it is set to True then no date is slected and if it is False then a non dynamic date is in the field.

Any help?
0
Comment
Question by:wlwebb
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
wlwebb earned 0 total points
ID: 34883336
Never Mind found this:

In the Worksheet_Activate, this will set the calendar each time the sheet is activated
Code:

Option Explicit

Private Sub Worksheet_Activate()
Me.Calendar1.Value = Date
End Sub

0
 

Author Closing Comment

by:wlwebb
ID: 34883341
see above
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 34883346
Why not set the date in the userform Initialize event?

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

Open in new window


Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 34883349
Oops... I am late...

Sid
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now