ich habe getsern von "Rudi Maintaire" einen VBA-Code erhalten, der auch wirklich super ist.
[code]
Private Sub Worksheet_Change(ByVal Target As Range)
Const strPW As String = "test123"
If Not Intersect(Target, Range("A:AK")) Is Nothing Then
On Error GoTo ERREXIT
Application.EnableEvents = False
If Target.Count > 1 Then
If Target.Count = Columns.Count Then
'ganze Zeile
If Application.InputBox("Passwort") strPW Then
MsgBox "test"
Application.Undo
End If
Else
'mehrere Zellen ausgewählt
Application.Undo
End If
Else
If Target.Column = 1 Then
'Änderung in A
If Target "" Then
If Target strPW Then
MsgBox "test"
Application.Undo
End If
End If
End If
Else
'Änderung in B:AK
If Cells(Target.Row, 1) = "" Then
'A leer
Application.Undo
Else
If Cells(Target.Row, 1) "" Or _
Cells(Target.Row, 4) "" Then
If Application.InputBox("Passwort") strPW Then
MsgBox "test"
Application.Undo
End If
End If
End If
End If
End If
End If
ERREXIT:
Application.EnableEvents = True
End Sub
[/code]
Allerdings wollte ich jetzt eine kleine Änderung einbauen und weiß nicht wie.
Ich will das Spalte G von dieser Überwachung + Schutzt außen vor bleibt. Also:
Spalte A:F & H:AK
Da ich nicht weiß, ob jemand meinen Post unten ließt mache ich einen neuen Beitrag auf, biite nicht schimpfen! ;-)
LG