Thanks again, Cytop. For your benefit and the forum members, I am posting this solution. In the "ThisWorkbook" module of the Add-In, this code was placed:
Private WithEvents mApp As Application
Private Sub mApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
' This will place an "x" in cell A1 if it is empty in the "testx" worksheet when cell A1 is clicked and will
' make cell A1 empty if it contains an "x" in the "testx" worksheet when cell A1 is clicked.
' Change "x", worksheet name, cell location, Add-In name, and Add-In Class Module name as needed.
mApp.EnableEvents = False
If Application.ActiveSheet.Name = "testx" Then
Set mc = ActiveWorkbook.Worksheets("testx").Cells(1, 1)
End If
If Application.ActiveSheet.Name = "testx" Then
If Target.Address = mc.Address Then
Select Case Target.Value
Case "x"
Target.Value = ""
Case Else
Target.Value = "x"
End Select
End If
End If
mApp.EnableEvents = True
End Sub
Private Sub Workbook_Open()
Set mApp = Application
End Sub
In the Class Module named "CExcelEvents" of the Add-In, this code was placed:
Private Sub Class_Initialize()
End Sub
After entering the code, you may have to save and close Excel, then open it.
Bookmarks