Re: zellenveränderung mitloggen
28.08.2002 16:18:56
Martin
Hallo Andiaus einem Forum (wo weiß ich nicht mehr) habe ich folgenden Code kopiert. Man muß diesen Code z. B. unter Tabelle1 im Visual-Basic-Editor eingeben. Gleichzeitig muß ein Tabellenblatt mit dem Namen "Protokoll TAB1" existieren. Das Makro protokolliert fast alles
Public varValue As String
Public strAddress As String
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim intRow As Integer
If CStr(Target.Formula) <> varValue Then
With Worksheets("Protokoll TAB1")
intRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
.Cells(intRow, 1).Value = strAddress
.Cells(intRow, 2).Value = "'" & varValue
.Cells(intRow, 3).Value = "'" & Target.Formula
.Cells(intRow, 4).Value = Now()
.Cells(intRow, 5).Value = Environ("Username") & " " & Application.UserName
varValue = CStr(Target.Value)
End With
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
varValue = CStr(ActiveCell.Formula)
strAddress = ActiveCell.Address
End Sub