Sollte beide Funktionen beinhalten:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim C&, NichtLeer As Boolean, R&, Wert#, V
Application.EnableEvents = False
On Error GoTo ExitSub
With Target
R = .Row
C = .Column
V = .Value
End With
Select Case R
Case Is > 14, Is < 5
Application.EnableEvents = True
Exit Sub
End Select
Select Case C
Case Is > 7, Is < 4
Application.EnableEvents = True
Exit Sub
Case 4: If V = "x" Then Wert = 3
Case Else: If V = "x" Then Wert = 1
End Select
If V <> "" Then 'neu
Range(Cells(R, 4), Cells(R, 7)).ClearContents 'neu
Target = "x" 'neu
End If
If Wert <> 0 Then
Cells(11 + R, 3) = Wert
Else
If Cells(R, 8).End(xlToLeft).Column < 4 Then
Cells(11 + R, 3) = ""
End If
End If
ExitSub:
Application.EnableEvents = True
End Sub
Es is nicht wirklich schwer das in VBA zu machen, wenn man weiß was man bzw. jemand anders will, der Sinn vom Excel-Formeln ist natürlich sowas möglichst einfach für Jeden umsetzbar zu machen und da sind sie auch ziehmlich effektiv... haben aber ihre Grenzen...
|