hi, ich nutze folgenden VBA-Code, damit nur A1 oder nur A2 geschrieben werden können:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$A$1" And Target <> "" Then
Range("A2") = Range("A1") / 60
ElseIf Target.Address = "$A$2" And Target <> "" Then
Range("A1") = ""
End If
Application.EnableEvents = True
End Su
So klappt es jedenfalls nicht.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$A$1" And Target <> "" Then
Range("A2") = ""
ElseIf Target.Address = "$A$2" And Target <> "" Then
Range("A1") = ""
End If
Application.EnableEvents = True
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$A$1" And Target <> "" Then
Range("A2") = Range("A1") / 60
ElseIf Target.Address = "$A$2" And Target <> "" Then
Range("A1") = ""
End If
Application.EnableEvents = True
End Su
So klappt es jedenfalls nicht.