AW: Extras Optionen Bearbeiten Markierung. Haken r
13.09.2007 19:15:00
Matthias
Hallo Peter
Nach der glorreichen Idee von Reinhard den Code so anzupassen hier der Code komplett
in ein Modul
Option Explicit
Public X1 As Boolean, x2 As Boolean, x3 As Boolean
Public OldFormel As String
in die Tabelle mit dem Bereich [Formelcheck1]
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.HasFormula = True Then X1 = True: OldFormel = Target.Formula
If ActiveCell.HasFormula = False Then X1 = False
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [Formelcheck1]) Is Nothing Then
If X1 = True And Not Target.HasFormula Then
MsgBox "Achtung es wurde folgende Formel überschrieben" & vbLf & "in " & Target.Address & ": " _
& OldFormel
End If
End If
End Sub
in die Tabelle mit dem Bereich [Formelcheck2]
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.HasFormula = True Then x2 = True: OldFormel = Target.FormulaLocal
If ActiveCell.HasFormula = False Then x2 = False
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [Formelcheck2]) Is Nothing Then
If x2 = True And Not Target.HasFormula Then
MsgBox "Achtung es wurde folgende Formel überschrieben" & vbLf & "in " & Target.Address & ": " _
& OldFormel
End If
End If
End Sub
in die Tabelle mit dem Bereich [Formelcheck3]
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.HasFormula = True Then x3 = True: OldFormel = Target.FormulaLocal
If ActiveCell.HasFormula = False Then x3 = False
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [Formelcheck3]) Is Nothing Then
If x3 = True And Not Target.HasFormula Then
MsgBox "Achtung es wurde folgende Formel überschrieben" & vbLf & "in " & Target.Address & ": " _
& OldFormel
End If
End If
End Sub
Hier die neue Datei: https://www.herber.de/bbs/user/46013.xls