I want to call a Macro (Rpt1) in Module1 by double-clicking a cell in Sheet2. I'm not certain how to do this. I seem to have the double click event executing from Sheet2 but I don't know how to call the macro I have in Module1.
You need to paste this code into your SHEET code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Const clickADDRESS As String = "A1" '<--- or whatever cell you want it to be
If Not Intersect(Target, Me.Range(clickADDRESS)) Is Nothing Then
Call Rpt1
End If
End Sub
which will call the macro in module code (my example)
Sub Rpt1()
MsgBox "This worked"
End Sub
By sheet code here's an illustration:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With