+ Reply to Thread
Results 1 to 2 of 2

Is it possible to ensure Calendar date is in range

  1. #1
    Robert Hargreaves
    Guest

    Is it possible to ensure Calendar date is in range

    I have a dynamic range set to a column with varying dates over a varying
    number of rows.

    I am asking the user to select a date with a related form. I need the user
    to select a date from the calendar control which appears in th dynamic
    range. Not within the Min / Max of the range but an exact match.

    My Calendar control is named Calendar1 how can I make sure the user picks a
    date in the range?

    Thank you for any help.

    Rob




  2. #2
    Bob Phillips
    Guest

    Re: Is it possible to ensure Calendar date is in range

    Hi Rob,

    Something like this

    Private Sub Calendar1_Click()
    Dim mtch
    mtch = Application.Match(CLng(Calendar1.Value),
    Worksheets("Sheet1").Range("A1:A1000"), 0)
    If IsError(mtch) Then
    MsgBox ("Invalid date")
    End If
    End Sub


    --
    HTH

    Bob Phillips

    "Robert Hargreaves" <[email protected]> wrote in message
    news:[email protected]...
    > I have a dynamic range set to a column with varying dates over a varying
    > number of rows.
    >
    > I am asking the user to select a date with a related form. I need the

    user
    > to select a date from the calendar control which appears in th dynamic
    > range. Not within the Min / Max of the range but an exact match.
    >
    > My Calendar control is named Calendar1 how can I make sure the user picks

    a
    > date in the range?
    >
    > Thank you for any help.
    >
    > Rob
    >
    >
    >




+ 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