Announcement

Collapse
No announcement yet.

Run macro on double click?

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Re: Run macro on double click?

    In XL 2003, there is a sheet event like so

    Code:
    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

    LinkedIn: Will Riley

    Comment


    • #3
      Re: Run macro on double click?

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

      Thanks very much !!
      Mark

      Comment


      • #4
        Re: Run macro on double click?

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

        LinkedIn: Will Riley

        Comment


        • #5
          Re: Run macro on double click?

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

          Mark

          Comment


          • #6
            Re: Run macro on double click?

            LOL
            Kind Regards, Will Riley

            LinkedIn: Will Riley

            Comment


            • #7
              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"
              Code:
              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

              Comment


              • #8
                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

                Comment


                • #9


                  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

                  New users should read the Forum Rules before posting

                  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.

                  Comment

                  Working...
                  X