Klasse initialisieren bei Excel-Start
Berndi
Gruß,
Berndi
Option Explicit
Dim oKlasseExcel As New Klasse1
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set oKlasseExcel = Nothing
End Sub
Private Sub Workbook_Open()
Set oKlasseExcel.ExcelEvent = Application
End Sub
kommt als Code in Klasse1
Option Explicit
Public WithEvents ExcelEvent As Application
Private Sub ExcelEvent_SheetChange(ByVal Sh As Object, ByVal Target As Range)
MsgBox Sh.Name & "!" & Target.Address(0, 0)
End Sub
Sonst müsstest Du etwas mehr schreiben.