+ Reply to Thread
Results 1 to 6 of 6

Worksheet_Selection Change Event

  1. #1
    Registered User
    Join Date
    07-19-2006
    Location
    Jamaica
    Posts
    86

    Question Worksheet_Selection Change Event

    Hi

    I'm fiddling with a worksheetwhere I want to be able to enter dates using a Calendar instead of punching in the dates manually.

    The Calendar is working fine but I don't know how to make it work for a range instead a single cell.

    I have the following code now:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "A20" Then
    Call OpenCalendar
    End If
    End Sub



    I need to have this work for the range A20:B500 - how do I do that?

    The code for the calendar I got from http://www.fontstuff.com/vba/vbatut07.htm
    And the above code I got from http://www.fontstuff.com/mailbag/qexcel02.htm



    /Møller
    Excel 2003
    Last edited by c991257; 11-20-2006 at 04:09 PM.
    --
    M?ller

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    You could use the Intersect method to determine if your cell is in the required range.


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-19-2006
    Location
    Jamaica
    Posts
    86
    That doesn't work for some reason. Any other ideas?


    /Møller

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,
    Have you tried
    Please Login or Register  to view this content.
    HTH
    Carim

  5. #5
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by c991257
    That doesn't work for some reason. Any other ideas?


    /Møller
    Hi,

    Please Login or Register  to view this content.
    should work

    ---
    Si fractum non sit, noli id reficere.

  6. #6
    Registered User
    Join Date
    07-19-2006
    Location
    Jamaica
    Posts
    86
    Dang. I had a typo in it. This works excellent. Thanks.

    /Møller


    Quote Originally Posted by Mallycat
    You could use the Intersect method to determine if your cell is in the required range.


    Please Login or Register  to view this content.

+ 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