Link to home
Start Free TrialLog in
Avatar of HKFuey
HKFueyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel macro double-click

Hi, I want to create a macro that pops up a message when I double-click a cell. Is this possible?
Can anyone help?
ASKER CERTIFIED SOLUTION
Avatar of gtgloner
gtgloner
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HKFuey

ASKER

Superb, just what I needed, thanks!
Thanks. As a follow up, if you needed the message box to show for double clicking on only one cell rather than any cell in the sheet, this code would be sufficient:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
 
 Dim LookIn As Range

    Set LookIn = Me.Range("A1")

    If Intersect(Target, LookIn) Is Nothing Then Exit Sub
    If ActiveCell = LookIn Then
    MsgBox ("Test message")
    End If
    
End Sub

Open in new window