+ Reply to Thread
Results 1 to 3 of 3

Range Problem in VBA

  1. #1
    Worzel Gummidge
    Guest

    Range Problem in VBA

    I currently have the following VBA code so that a calendar appears in cell
    HG:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    Boolean)
    If Target.Address = "$H$6" Then
    Cancel = True
    Call OpenCalendar
    End If
    End Sub
    _____________________

    This code works great and inserts the relevant date into the cell etc...
    Nonetheless, I want to ammend this code so that I can double click on any
    cell within the range H6:H1000 (as opposed to only Cell H6) and the calendar
    will pop up and the user can select a date and it will be entered into the
    cell.

    Any ideas?



  2. #2
    Bob Phillips
    Guest

    Re: Range Problem in VBA

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    Boolean)
    If Not Intersect(Target, Range("H6:H1000")) Is Nothing Then
    Cancel = True
    Call OpenCalendar
    End If
    End Sub


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Worzel Gummidge" <[email protected]> wrote in message
    news:[email protected]...
    > I currently have the following VBA code so that a calendar appears in cell
    > HG:
    >
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    > Boolean)
    > If Target.Address = "$H$6" Then
    > Cancel = True
    > Call OpenCalendar
    > End If
    > End Sub
    > _____________________
    >
    > This code works great and inserts the relevant date into the cell etc...
    > Nonetheless, I want to ammend this code so that I can double click on any
    > cell within the range H6:H1000 (as opposed to only Cell H6) and the

    calendar
    > will pop up and the user can select a date and it will be entered into the
    > cell.
    >
    > Any ideas?
    >
    >




  3. #3
    Worzel Gummidge
    Guest

    Re: Range Problem in VBA

    Cheers Bob

    Problem solved

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    > Boolean)
    > If Not Intersect(Target, Range("H6:H1000")) Is Nothing Then
    > Cancel = True
    > Call OpenCalendar
    > End If
    > End Sub
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Worzel Gummidge" <[email protected]> wrote in message
    > news:[email protected]...
    >> I currently have the following VBA code so that a calendar appears in
    >> cell
    >> HG:
    >>
    >> Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
    >> Boolean)
    >> If Target.Address = "$H$6" Then
    >> Cancel = True
    >> Call OpenCalendar
    >> End If
    >> End Sub
    >> _____________________
    >>
    >> This code works great and inserts the relevant date into the cell etc...
    >> Nonetheless, I want to ammend this code so that I can double click on any
    >> cell within the range H6:H1000 (as opposed to only Cell H6) and the

    > calendar
    >> will pop up and the user can select a date and it will be entered into
    >> the
    >> cell.
    >>
    >> Any ideas?
    >>
    >>

    >
    >




+ 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