Enden
serge
Mit folgendem Makro rufe ich ein Formular auf
Sub commandbutton()
Sadresse = Selection.Address(RowAbsolute:=False, columnAbsolute:=False)
If Application.CountA(Range(Sadresse)) > 0 Then
MsgBox ("In der ausgwählten Zeitspanne besteht schon ein Termin!")
Else
Dim wahl
ActiveSheet.Unprotect Password:="smart"
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Sadresse = Selection.Address(RowAbsolute:=False, columnAbsolute:=False)
wahl = MsgBox("Wollen Sie im ausgewähltem Bereich " & vbCrLf & vbCrLf & " " & Selection.Address(RowAbsolute:=False, columnAbsolute:=False) & " " & vbCrLf & vbCrLf & " einen Termin festlegen?", vbYesNo, "Termin einfügen!")
Application.ScreenUpdating = True
If wahl = vbYes Then
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 0
Übersicht.Show ActiveSheet.Protect Password:="smart", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Labtopbeamer").Select
Range(Sadresse).Select
CommandButtonpc
Else
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 0
ActiveSheet.Protect Password:="smart", DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End If
End Sub
wenn ich nun dieses Formular abbrech mit:
Private Sub CommandButton3_Click()
Application.EnableEvents = False
Unload Me
Application.EnableEvents = True
End Sub
möchte ich das Makro Sub commandbutton() auch abbrechen!
Wie stelle ich das an?
Im jetzigen Zustand geht mein markro bie
Contents:=True, Scenarios:=True
weiter
danke Serge