PDA

View Full Version : Solved: Date not updated from the calendar popup



rajagopal
02-19-2009, 07:30 AM
Hi,
I've calendar popup functionality enabled in the excel file range F2, J5:J14
I've two command buttons - OK, Cancel.
When i select a date and click OK, the date is not updated in the sheet.
Similarly, Cancel button.
Please help me, attached the file for your ref.

Raj

Kenneth Hobs
02-19-2009, 07:47 AM
Your cancel and ok buttons were not the ones you thought. Doubleclick your command buttons on the userform in the VBE to get to the right code for them.
Private Sub CommandButton3_Click()
Unload Me
End Sub

Private Sub CommandButton4_Click()
ActiveCell.Value = Calendar1.Value
Unload me
End Sub

'a doubleclick might be nice
Private Sub Calendar1_DblClick()
ActiveCell.Value = Calendar1.Value
Unload Me
End Sub

rajagopal
02-19-2009, 07:54 AM
Got it thanks.