'This is a global variable, prevents endless loops in worksheet change.
Dim running As Boolean
'When any change is made on the worksheet, sends target as the changed cell
'Private Sub Status_Change(ByVal Target As Range)
'Checks to see if a worksheet change is already running, if it is, then it quits
If running = True Then Exit Sub
'We are running code now, so prevent endless loops
running = True
Dim Status, StatusInWords As Integer
'Set to your values
Status = 14
StatusInWords = 15
' If this is a column you want to change
If Target.Column = StatusInWords Then
'Change values
If Target.Value = "offen" Then
Target.Offset(0, -Abs(Status - StatusInWords)).Value = "0%"
ElseIf Target.Value = "In Arbeit" Then
Target.Offset(0, -Abs(Status - StatusInWords)).Value = "50%"
ElseIf Target.Value = "vorlüufig abgeschlossen" Then
Target.Offset(0, -Abs(Status - StatusInWords)).Value = "80%"
ElseIf Target.Value = "abgeschlossen ohne ergebniseintrag" Then
Target.Offset(0, -Abs(Status - StatusInWords)).Value = "90%"
ElseIf Target.Value = "Closed" Then
Target.Offset(0, -Abs(Status - StatusInWords)).Value = "100%"
End If
'If this is the other column you want to change
ElseIf Target.Column = Status Then
'Change values
If Target.Value = 0 Then
Target.Offset(0, Abs(Status - StatusInWords)).Value = "offen"
ElseIf Target.Value = 0.5 Then
Target.Offset(0, Abs(Status - StatusInWords)).Value = "In Arbeit"
ElseIf Target.Value = 0.8 Then
Target.Offset(0, Abs(Status - StatusInWords)).Value = "vorlüufig abgeschlossen"
ElseIf Target.Value = 0.9 Then
Target.Offset(0, Abs(Status - StatusInWords)).Value = "abgeschlossen ohne ergebniseintrag"
ElseIf Target.Value = 1 Then
Target.Offset(0, Abs(Status - StatusInWords)).Value = "Closed"
End If
End If
running = False