+ Reply to Thread
Results 1 to 3 of 3

Calendar Input

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-04-2003
    Location
    Burrton, Kansas USA
    MS-Off Ver
    2003
    Posts
    162

    Calendar Input

    Hi!
    I have a userform (in the form of a calendar) that I want to input a date with. It activates alright and when I click on a date it does input the date to the active cell but I cannot then click on another cell, I must close the userform and then select another cell. What I want is:

    1. The form to remain visible while I select another cell to input to.
    2. The input cell must be in the range named "Dates".

    This is the code in the userform.
    < code start >
    Option Explicit
    Private Sub Calendar1_Click()

    ActiveCell.NumberFormat = "mm/dd/yyyy"
    If ActiveCell.Address = Range("Dates") Then
    ActiveCell.Value = Calendar1.Value
    Else
    Exit Sub
    End If
    End Sub
    < code stop >

    Any help or direction would be appreciated! Thanks!

  2. #2
    Tom Ogilvy
    Guest

    RE: Calendar Input

    Option Explicit
    Private Sub Calendar1_Click()
    ActiveCell.NumberFormat = "mm/dd/yyyy"
    If not Intersect(ActiveCell,Range("Dates")) is nothing then
    ActiveCell.Value = Calendar1.Value
    End if
    End sub

    --
    Regards,
    Tom Ogilvy



    "Brian Matlack" wrote:

    >
    > Hi!
    > I have a userform calendar that I want to input a date with. What I
    > want is:
    >
    > 1. The form to remain visible while I select another cell to input to.
    > 2. The input cell must be in the range "Dates"
    >
    > This is the code in the userform. This code does not work.
    > < code start >
    > Option Explicit
    > Private Sub Calendar1_Click()
    >
    > ActiveCell.NumberFormat = "mm/dd/yyyy"
    > If ActiveCell.Address = Range("Dates") Then
    > ActiveCell.Value = Calendar1.Value
    > Else
    > Exit Sub
    > End If
    > End Sub
    > < code stop >
    >
    > Any help or direction would be appreciated! Thanks!
    >
    >
    > --
    > Brian Matlack
    > ------------------------------------------------------------------------
    > Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
    > View this thread: http://www.excelforum.com/showthread...hreadid=544355
    >
    >


  3. #3
    Forum Contributor
    Join Date
    12-04-2003
    Location
    Burrton, Kansas USA
    MS-Off Ver
    2003
    Posts
    162
    Thanks Tom! The code works Great! I'll keep working on the problem with keeping the userform visible while I select a different cell.
    Thanks again!!

+ 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