ich habe einen Changelog gebastelt, der ALLE Änderungen in einer Excel Datei protokolliert für alle ersichtlich. Somit einfacher für Nachfragen, wer was wann geändert hat, da es sofort ersichtlich ist.
Es funktioniert auch wunderbar, bis auf 2 Probleme:
1. Problem: Die Funktion "STRG-Z" funktioniert nicht mehr. Ist es mögliche, dass diese Funktion nutzbar ist zusammen mit dem Changelog?
2. Problem: Wie schaffe ich es, wenn ein Nutzer mehrere Zellen markiert und alle auf einmal löscht, alle zu protokollieren?
Aktuell bricht er ja die Protokollierungsfunktion ab, wenn mehr als 1 Zelle markiert wurde... wenn ich diese auskommentiere, wird immer nur die erste der markierten Zellen protokolliert.
Danke für Tipps/Hilfe!
Code befindet sich in "DieseArbeitsmappe":
Option Explicit
Dim vOldVal
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim bBold As Boolean
If Target.Cells.Count > 1 Then Exit Sub '
On Error Resume Next
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
If IsEmpty(vOldVal) Then vOldVal = ""
bBold = Target.HasFormula
With Worksheets("Changelog")
.Unprotect Password:="Secret"
If .Range("A1") = vbNullString Then
.Range("A1:G1") = Array("Veränderte Zelle", "Verändertes Arbeitsblatt", " _
Alter Inhalt", _
"Neuer Inhalt", "Änderungszeit", "Änderungsdatum", "Benutzer")
End If
With .Cells(.Rows.Count, 1).End(xlUp)(2, 1)
.Value = Target.Address
.Offset(0, 1) = Sh.Name
.Offset(0, 2) = vOldVal
With .Offset(0, 3)
If bBold = True Then
.ClearComments
End If
.Value = Target
.Font.Bold = bBold
End With
.Offset(0, 4) = Time
.Offset(0, 5) = Date
.Offset(0, 6) = Application.UserName
End With
.Cells.Columns.AutoFit
.Protect Password:="Secret"
End With
vOldVal = vbNullString
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
On Error GoTo 0
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
vOldVal = Target
End Sub
Gruß Alex