-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExcel4AclsSheetEvent.cls
39 lines (35 loc) · 1.01 KB
/
Excel4AclsSheetEvent.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "clsSheetEvent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public CollectinIdx As Integer
Public WithEvents Worksheet As Worksheet
Attribute Worksheet.VB_VarHelpID = -1
Private MenuDefined As Boolean
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Rows.Count >= 1 And Target.row >= 2 And IsDate(Cells(Target.row, 14).value) Then
MenuDefined = False
BuildCustomMenuFndLogFile 'build new menu
MenuDefined = True
Else
If MenuDefined Then
DeleteCustomMenuFndLogFile 'remove possible duplicates
MenuDefined = False
End If
End If
End Sub
Private Sub Worksheet_Deactivate()
DeleteCustomMenuFndLogFile
MenuDefined = False
End Sub
Private Sub Class_Terminate()
DeleteCustomMenuFndLogFile
MenuDefined = False
Set Worksheet = Nothing
End Sub