Results 1 to 4 of 4

Thread: Pop up calendar/control to select date

  1. #1
    Senior Member
    Join Date
    Jul 2013
    Posts
    102
    Rep Power
    12

    Pop up calendar/control to select date

    Hi

    Is there a method of selecting a date for columns "Deadline" and "Completed".Can a pop up calender or even a dropdown list of dates be possible.For column "Deadline" can a dropdown list for todays date plus 30 days be done.In the column "Completed" can a dropdown list of todays date minus a week and plus a week be done.
    Cheers
    Jeff
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Posts
    102
    Rep Power
    12
    Bump

  3. #3
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Insert a userform with a combobox and a command button.

    in the userform module put this code.

    Code:
    Option Explicit
    
    Private Sub CommandButton1_Click()
        
        ActiveCell.Value = CDate(Me.ComboBox1.Value)
        Unload Me
        
    End Sub
    
    Private Sub UserForm_Initialize()
        
        Dim Dt()    As String
        Dim n       As Long
        Dim cDt     As Date
        Dim sDt     As Date
        
        sDt = Date
        Select Case ActiveCell.Column
            Case 4
                ReDim Dt(1 To 31)
                n = 1
                Do While sDt >= Date - 30
                    Dt(n) = Format(sDt, "mm-dd-yyyy")
                    sDt = sDt - 1
                    n = n + 1
                Loop
                With Me.ComboBox1
                    .List = Dt
                    .ListIndex = 0
                End With
            Case 6
                ReDim Dt(1 To 15)
                n = 1
                sDt = Date - 7
                Do While sDt <= Date + 7
                    Dt(n) = Format(sDt, "mm-dd-yyyy")
                    sDt = sDt + 1
                    n = n + 1
                Loop
                With Me.ComboBox1
                    .List = Dt
                    .ListIndex = 7
                End With
        End Select
        
    End Sub
    Right click TASKS worksheet > view code and paste the following code

    Code:
    Option Explicit
    
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
        
        Select Case Target.Column
            Case 4, 6
                Cancel = True: UserForm1.Show
        End Select
    
    End Sub
    Now right click on Col 4 or 6, the userform will popup with a set of dates and select one date hit the command button.

    I can't upload a file that's why this detailed explanatin.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  4. #4
    Senior Member
    Join Date
    Jul 2013
    Posts
    102
    Rep Power
    12
    very nice.thank you
    Jeff

Similar Threads

  1. Code to pop up message when there is a variance
    By Howardc in forum Excel Help
    Replies: 1
    Last Post: 08-13-2013, 12:45 PM
  2. VBA To Display Pop Up Alert When Duplicate Entry Is Made
    By peter renton in forum Excel Help
    Replies: 20
    Last Post: 07-26-2013, 07:56 PM
  3. Non-ActiveX Calendar / MonthView Control
    By Excel Fox in forum Excel Ribbon and Add-Ins
    Replies: 1
    Last Post: 07-18-2013, 09:14 AM
  4. Replies: 5
    Last Post: 06-15-2013, 12:40 PM
  5. Select Sheets For Specific Date By Clicking On A Calendar
    By peter renton in forum Excel Help
    Replies: 10
    Last Post: 05-17-2013, 01:57 PM

Posting Permissions

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