vba calendar

  • Thread starter Thread starter Jennifer
  • Start date Start date
J

Jennifer

I am using a form that has a calendar in it. Does anyone know how to get it
to show todays date when the form opens verses the date i built the form? Not
a huge problem just very annoying.
 
I'm assuming by "form" you mean UserForm and by "calendar" you mean the
Calendar Control. Further assuming your Calendar Control is named Calendar1,
put the following code in the UserForm's code window...

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

Obviously, if you already have an existing UserForm_Initialize event
procedure in your project, simply add the

Calendar1.Value = Date

statement to it instead.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top