PDA

View Full Version : Solved: Calendar pop up with date AND time



AleemAM123
04-02-2011, 06:09 AM
Hi everyone,

I'm trying to create a form for data input and I want a calendar popup when you click on a particular column, column C. I have gotten it to work for one cell, C15 (the code for this is under sheet1.


The orignal excel sheet came from this site: http://www.fontstuff.com/vba/vbatut07.htm



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo errH
Application.EnableEvents = False
Select Case Target.Address(0, 0)
Case "B15"
Range("B218:B219").Select
Case "C15"
Call OpenCalendar


'Case "C15"
'Call Macro2(Target)
Case Else
GoTo errH
End Select
errH:
Application.EnableEvents = True



Is there any way to do this?

The other thing is I wanted the user to be able to select a date and a time from the same control. Is there a calendar that shows the time as well?

Thanks in advance.

Bob Phillips
04-02-2011, 07:34 AM
I don't know of one, you would need to build it yourself.

AleemAM123
04-02-2011, 09:23 PM
oh :( ...

Well in this sheet is there any way to get the calendar to pop up for any cell in column C?

Bob Phillips
04-03-2011, 04:08 AM
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Goto errH
Application.EnableEvents = False

If Not Intersect(Target, Me.Columns("C")) Is Nothing Then

Call OpenCalendar

ElseIf Target.Address = "$B$15" Then

Range("B218:B219").Select
End If
errH:
Application.EnableEvents = True
End Sub

AleemAM123
04-03-2011, 05:25 AM
Thanks XLD!