Przemyslaw Remin
Przemyslaw Remin

Reputation: 6950

VBA event functions Worksheet and Workbook_sheet

What is the difference between functions:
Worksheet_BeforeDoubleClick
Workbook_SheetBeforeDoubleClick
?

Upvotes: 1

Views: 228

Answers (2)

Rory
Rory

Reputation: 34075

Worksheet_BeforeDoubleClick is specific to whichever sheet the code is located in, whereas Workbook_SheetBeforeDoubleClick will be triggered by double-clicking any sheet in the workbook (assuming you have it correctly located in the ThisWorkbook module).

Upvotes: 3

Mark Moore
Mark Moore

Reputation: 510

The Workbook_SheetBeforeDoubleClick is a workbook level event and so the code in here would trigger for every sheet in the workbook if you double click The Worksheet_BeforeDoubleClick is a worksheet level event and so goes inside the individual worksheet and only applies to double clicking in that worksheet

Upvotes: 2

Related Questions