PDA

View Full Version : Using Calendar Control to fill in dates



Panda
01-19-2011, 08:48 AM
Hey All,

I have a spreadsheet where when a cell is selected a pop up calender appears and once the user has selected a date, I want the date selected to be into the active cell. I have found some helpful examples on some sites, and although I have managed to create the calendar I cant seem to get the macros behind it to work.

Attached is my spreadsheet.

Can someone help?

Thanks

Phil

Tinbendr
01-19-2011, 09:59 AM
You were so close.

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value

David

Panda
01-20-2011, 09:58 AM
Doh!!!... I thought it would be something simple, thanks for your help it is now working a treat. Is there anyway of getting the calendar to automatically pop up when a cell is selected.

For example for any cell within column A?

Thanks again =:)

Tinbendr
01-20-2011, 10:26 AM
In the Sheet code page;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
frmCalendar.Show
End If
End Sub

David

domfootwear
01-20-2011, 07:41 PM
In the Sheet code page;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
frmCalendar.Show
End If
End Sub
David

You can use DTPicker i.o frmCalendar

shrivallabha
01-20-2011, 10:32 PM
Just a word of caution (maybe you know about it). Maybe you can go through the thread to assess your case.
http://www.vbaexpress.com/forum/showthread.php?t=35548

Panda
01-21-2011, 04:05 AM
Thanks for you help people it works a treat =:D