Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    range event (2000)

    Hi all,

    I would like to run a procedure from a certain range of cells, every time I double click in a certain range I would like to activate a userform.

    Can anyone help?

    Thank you in Advance.

    Darryl.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: range event (2000)

    Add this to the code pane of the sheet object of interest:

    <pre>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
    If Not Intersect(Target, Range("A1:C10")) Is Nothing Then
    frmYourform.Show
    Cancel = True
    End If
    End Sub</pre>


    Change the form name and the range as appropriate

    Steve

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: range event (2000)

    In Steve's approach you can double-click directly in the appropriate range and trigger the macro. I'm not comparing my approach to Steve's (which is much better anyhow!). I thought I'd just throw out another not so common approach that is also possible and easier for those that are not so "on the ball" with VBA.
    Regards,
    Rudi

  4. #4
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: range event (2000)

    Thank you very much........

Posting Permissions

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