PDA

View Full Version : Solved: Get selected Date



justdriving
09-22-2011, 01:22 AM
On opening this workbook, how can I select any date and pass on the selected value from Userform to a variable DateTaken using VBA. Please help.

Bob Phillips
09-22-2011, 03:20 AM
Add this to the form



Private Sub Calendar1_Click()
DateTaken = Calendar1.Value
End Sub


and in the module use



Public DateTaken As Date

Sub Calen11()
With Calendar2011

.Show
MsgBox DateTaken
End With
End Sub