Gruppe
Feature
Problem
Wenn in Spalte C in B steht, darf in Spalte F weder ein T noch ein F akzeptiert werden. Lösung über Menü DATEN / GÜLTIGKEIT.
ClassModule: Tabelle1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, oCell As Range
If Target.Font.Bold = False Then Exit Sub
If Target.Value = "" Then Exit Sub
If IsNumeric(Target.Value) = False Then Exit Sub
On Error GoTo ERRORHANDLER
Application.EnableEvents = False
With Range("A1").CurrentRegion
For Each oCell In .Cells
If oCell.Value = Target.Value And oCell.Font.Bold And oCell.Address <> Target.Address Then
Beep
MsgBox "Der eingegebene Wert existiert bereits!"
Target.ClearContents
Exit For
End If
Next oCell
End With
ERRORHANDLER:
Application.EnableEvents = True
End Sub
Sub a()
Application.EnableEvents = True
End Sub