Date Time Picker

H

Haarish

Guys,

I have added a calendar control to an Excel 2007 worksheet. I am
trying to pick the selected value in the code section with the
calendar_click() function. I havent been able to pick the date part
from the calendar control. Am I doing something wrong? Is there an
easier way to do this?


Thanks in advance.
 
H

Haarish

Hi Nigel,

I have handled the code this way:

Private Sub Calendar1_Click()
MsgBox Calendar1.Value
Cells(9, 3).Value = Calendar1.Value
Cells(9, 3).NumberFormat = "mm/dd/yyyy"
Cells(9, 3).Select
End Sub

But the msgbox returns a NULL value. So I set the date in the
properties box to today's date - '04/10/2009'. But a change in the
month has no effect in the value of the calendar object. I am not sure
where the disconnect happens!

Thanks,
Haarish.
 
R

Rick Rothstein

So we know exactly what control you are using, select the calendar control
on your User Form and, in the Properties window, click the About property
(then the ... button) and tell us what it says the control is. When I used
the "Microsoft Office Access Calendar Control", your code worked perfectly
for me.

--
Rick (MVP - Excel)


Hi Nigel,

I have handled the code this way:

Private Sub Calendar1_Click()
MsgBox Calendar1.Value
Cells(9, 3).Value = Calendar1.Value
Cells(9, 3).NumberFormat = "mm/dd/yyyy"
Cells(9, 3).Select
End Sub

But the msgbox returns a NULL value. So I set the date in the
properties box to today's date - '04/10/2009'. But a change in the
month has no effect in the value of the calendar object. I am not sure
where the disconnect happens!

Thanks,
Haarish.
 

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

Similar Threads


Top