DoubleClick macro not working at all

alexdowd2

New Member
Joined
Apr 15, 2022
Messages
19
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
I have a simple Double Click macro that works elsewhere but in this particular workbook nothing happens. I double click into the cell and it just goes to edit mode, no macro runs. EnableEvents is True and the only other thing I can think of is it has something to do with both sheets being SQL Query-Connected tables OR that there are duplicate IDs in Column 1 on the Invoice Data worksheet. If it's the latter, is there a way to maintain this functionality with duplicates?

Private Sub Workshseet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If ActiveCell.Column = 1 Then

Sheets("Invoice Data").ListObjects("Invoice").Range.AutoFilter Field:=1, Criteria1:=ActiveCell.Value
Sheets("Invoice Data").Activate

End If

End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It looks like you have a typo. It should be . . .

VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Hope this helps!
 
Upvote 0
Solution
It looks like you have a typo. It should be . . .

VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Hope this helps!
You're the man, thank you sir
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top