Well, you can, sort of. But do you really want to? A Select Case may
be better. But if you must, here's some code:
'<In class module named Class1>--------
Option Explicit
Private WithEvents m_oWorksheet As Excel.Worksheet
Private m_oRange As Excel.Range
Public Event SelectionChange()
Private Sub m_oWorksheet_SelectionChange(ByVal Target As Range)
If Not Excel.Application.Intersect(m_oRange, Target) Is Nothing Then
RaiseEvent SelectionChange
End If
End Sub
Public Function Init( _
ByVal ExcelWorksheet As Excel.Worksheet, _
ByVal ExcelRange As Excel.Range _
) As Boolean
Set m_oWorksheet = ExcelWorksheet
Set m_oRange = ExcelRange
End Function
'</In class module named Class1>--------
'<In a sheet code module>--------
Option Explicit
Private WithEvents oC1 As Class1
Private WithEvents oC2 As Class1
Private WithEvents oC3 As Class1
Public Function Init() As Boolean
Set oC1 = New Class1
oC1.Init Me, Me.Range("A1")
Set oC2 = New Class1
oC2.Init Me, Me.Range("A2")
Set oC3 = New Class1
oC3.Init Me, Me.Range("A3")
End Function
Private Sub oC1_SelectionChange()
MsgBox "Event handler 1"
End Sub
Private Sub oC2_SelectionChange()
MsgBox "Event handler 2"
End Sub
Private Sub oC3_SelectionChange()
MsgBox "Event handler 3"
End Sub
Public Function Destroy() As Boolean
Set oC1 = Nothing
Set oC2 = Nothing
Set oC3 = Nothing
End Function
'</In a sheet code module>--------
'<In ThisWorkbook code module>--------
Option Explicit
Private Sub Workbook_Open()
Sheet1.Init
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Destroy
End Sub
'</In ThisWorkbook code module>--------
--