title: Start macro by double click
body: <p>I'm trying to start a macro through double clicking a cell.</p>
  
  <p>I copied this code directly from the internet, but it is not working when I double click the cell C40.</p>
  
  <pre><code>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
      If Not Application.Intersect(Target, Range("C40")) Is Nothing Then
          Cancel = True
          SelectPayFreq.Show
      End If
  End Sub
  </code></pre>