Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 9 of 9

Thread: Run macro on double click?

  1. #1
    Join Date
    13th January 2005
    Location
    Ontario
    Posts
    229

    Run macro on double click?

    Is there a way to run a macro only when you double click on a certain cell, but not when you single click? I know this is kind of a weird question ... but I am trying to popup a calender in a cell, so that the user can select a date. I am able to have it work when the user activates the cell, but this is not very friendly. Thanks alot

    Mark

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    28th January 2003
    Location
    Solihull - England
    Posts
    8,677

    Re: Run macro on double click?

    In XL 2003, there is a sheet event like so

    VB:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
         'your code here
    End Sub 
    
    
    I am unsure (don't think so tho) as to if this was do-able in 97. Maybe someone with 97 can check...
    Kind Regards, Will Riley

    Web Presence:
    Personal: Datasapien
    LinkedIn: Will Riley

  3. #3
    Join Date
    13th January 2005
    Location
    Ontario
    Posts
    229

    Re: Run macro on double click?

    Actually ... that works perfectly in 97. That is exactly what I needed.

    Thanks very much !!
    Mark

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    28th January 2003
    Location
    Solihull - England
    Posts
    8,677

    Re: Run macro on double click?

    Excellent.... my memory is worse than I figured
    Kind Regards, Will Riley

    Web Presence:
    Personal: Datasapien
    LinkedIn: Will Riley

  5. #5
    Join Date
    13th January 2005
    Location
    Ontario
    Posts
    229

    Re: Run macro on double click?

    Yeah .. I'm feeling my age too. When I start calling people "young whipersnappers" please shoot me.

    Mark

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    28th January 2003
    Location
    Solihull - England
    Posts
    8,677

    Re: Run macro on double click?

    LOL
    Kind Regards, Will Riley

    Web Presence:
    Personal: Datasapien
    LinkedIn: Will Riley

  7. #7
    Join Date
    13th January 2005
    Location
    Ontario
    Posts
    229

    Re: Run macro on double click?

    Can you please help me with nesting in this command WillR? I would like the code to work in columns 4 & 5, as well as cells "c6" and "g6"
    VB:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
        If Target.Column = 4 Or Target.Column = 5 Then 
            frmcalender.OpenCalendar 
        End If 
    End Sub 
    
    
    Not sure how to do the nesting.

    Thanks
    Mark

    Excel Video Tutorials / Excel Dashboards Reports


  8. #8
    Join Date
    30th January 2007
    Location
    South Africa
    Posts
    22

    Re: Run macro on double click?

    Hi
    I'm looking for something similar. I want the calendar popup (already created) to activate when I double click on any cell within the range Sheet 1 G5:G5

    Excel Video Tutorials / Excel Dashboards Reports


  9. #9
    Join Date
    26th January 2003
    Location
    Derbyshire,UK
    Posts
    18,029

    Re: Run macro on double click?

    Post your own question please, add a link to this question if it helps. The Forum Rules specifically ask you not to hijack questions in this way.
    Hope that Helps

    Roy

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Replies: 2
    Last Post: February 7th, 2008, 16:56
  2. Replies: 4
    Last Post: March 6th, 2007, 00:45
  3. Run Macro On Double Click
    By TJE in forum EXCEL HELP
    Replies: 2
    Last Post: October 26th, 2006, 15:56
  4. Double Click
    By gmccreedy in forum EXCEL HELP
    Replies: 1
    Last Post: October 11th, 2005, 07:52
  5. VBA Code for Double Click
    By rpaulson in forum EXCEL HELP
    Replies: 21
    Last Post: March 20th, 2005, 02:48

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
  •  
porno