Consulting

Results 1 to 5 of 5

Thread: Solved: Calendar pop up with date AND time

  1. #1

    Red face Solved: Calendar pop up with date AND time

    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

    [VBA]

    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

    [/VBA]

    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.
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I don't know of one, you would need to build it yourself.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    oh ...

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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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[/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Thanks XLD!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •