+ Reply to Thread
Results 1 to 13 of 13

date selection in a cell?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    re: date selection in a cell?

    Oh, sorry, I missed out the attached file.

    The calendar is great. but when I double click on the yellow column, I can't choose the dates without pressing ESC or clicking on another cell. Is there a command line that controls this action?

    May I know what does [A:A] means? Can I change to specific cells like M9:M17, M18:M22, etc?
    I tried [M9:M17], [M18:M22], but [M9:M17],[M18:M22] are not working. Removing [M18:M22], [M9:M17] will work.

    How do I put the calendar into my excel file?
    Last edited by Lewis Koh; 01-04-2010 at 01:58 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    re: date selection in a cell?

    Quote Originally Posted by Lewis Koh View Post
    Oh, sorry, I missed out the attached file.

    The calendar is great. but when I double click on the yellow column, I can't choose the dates without pressing ESC or clicking on another cell. Is there a command line that controls this action?

    May I know what does [A:A] means? Can I change to specific cells like M9:M17, M18:M22, etc?
    I tried [M9:M17], [M18:M22], but [M9:M17],[M18:M22] are not working. Removing [M18:M22], [M9:M17] will work.

    How do I put the calendar into my excel file?


    1) After dbl-clicking a Col_A cell, the Calendar form pops up.
    •Click a date...it will be entered in the active cell and the form will close
    or
    •Click the Cancel button to just close the form

    2)[A:A] designates that all Col_A cells, when dbl-clicked, engage the form.

    3)To only use M9:M17 and M18:M22(...which is really M9:M22, right?)
    Change the Sheet1 code to:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(ActiveCell, [M9:M22]) Is Nothing Then
            PopUpCalEntry ActiveCell
        End If
    End Sub
    4)To use the pop-up calendar functionality in your workbook....
    •Open the demo workbook AND your workbook
    •[Alt]-[F11] to open the VBA editor
    From the VBA Project window
    •Drag the frmCal from the demo to your workbook
    •Drag Module1 from the demo to your workbook
    •Dbl-Click the demo Sheet1 to see the code (make sure it's edited for M9:M22)
    •Copy all of the Sheet1 code
    •Dbl-Click your sheet to see the code
    •Paste the demo Sheet1 code into your sheet module
    Done...your workbook should now display the pop-up when a cell in M9:M22 is dbl-clicked.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Re: date selection in a cell?

    1) After dbl-clicking a Col_A cell, the Calendar form pops up.
    •Click a date...it will be entered in the active cell and the form will close
    or
    •Click the Cancel button to just close the form

    I can't choose the date after the pop-up. I had to click on another cell to sort of activate the calendar pop-up before I can choose a date.

    2)[A:A] designates that all Col_A cells, when dbl-clicked, engage the form.
    Does that mean if I wanted column M to be the input column, I should change to [M:M]?

    3)To only use M9:M17 and M18:M22(...which is really M9:M22, right?)
    Change the Sheet1 code to:

    Oh sorry, I had other info on M18 so the column should be M9:M17 and M19:M22. I had a lot of other rows on column M that need not have date input, thus I'm wondering if I could set the pop-up on multiple rows with breaks in between them..

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: date selection in a cell?

    1) I don't understand why you are experiencing the odd calendar behavior.
    I cannot replicate it on Excel 2003. When I dbl-click a target cell, the
    calendar pops up. When I click on a date in the calendar, the date is posted
    in the active cell and the form closes.

    2) Yes, you would refer to Col_M by replaceing [A:A] with [M:M].

    3) To refer to M9:M17, M19:M22...
    •Select those two clusters of cells.
    •Assign a name to them (I used MyDateCells)
    •Use the below code in the sheet module:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(ActiveCell, [MyDateCells]) Is Nothing Then
            PopUpCalEntry ActiveCell
        End If
    End Sub

  5. #5
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Re: date selection in a cell?

    Oh, could it be because I am using Excel 2000?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1