PDA

View Full Version : set calendar to open at a specified date.



wilg
03-28-2011, 09:47 PM
Hi guys, have the below code which works great, but is there a way to set the date to 01/01/ & current year, each time it pops up? Right now it opens to todays date only.


Private Sub Calendar1_Click()
ActiveCell = Calendar1.Value
ActiveCell.NumberFormat = "mm/dd/yy/h:mm am/pm"
Unload UserForm1
End Sub

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

p45cal
03-29-2011, 02:03 AM
Private Sub UserForm_Activate()
Me.Calendar1.Value = DateSerial(Year(Date), 1, 1)
End Sub