AW: Ein paar Fragen weg. meiner Arbeitsmappe
19.03.2023 16:50:37
Rudi Maintaire
Hallo,
neue Blätter würde ich eher so anlegen:
Sub Hospitationen_erstellen()
Dim BlattName As String
Dim wks As Worksheet
BlattName = InputBox("Für welches Jahr?", "Hospitation anlegen")
If BlattName > "" Then
If BlattName Like "####" Then '4 Ziffern
BlattName = "Hospitationen " & BlattName
On Error Resume Next
Set wks = Worksheets(BlattName)
On Error GoTo 0
If wks Is Nothing Then
Sheets("Hospitationen Neu").Copy after:=Sheets(3)
ActiveSheet.Name = BlattName
Else
MsgBox "Das Blatt " & BlattName & " gibt es schon!", , "Fehler"
End If
Else
MsgBox "Der Name ist ungültig", , "Fehler"
End If
End If
End Sub
Führungen analog.
Auffälliger Button für die Maske:
Dann erstell dir einen.
Code
Sub Maske()
With ActiveSheet
.Unprotect
.ShowDataForm
End With
End Sub
Ich glaube aber nicht, dass du auf Dauer mit der Maske glücklich wirst. Ich würde mir eine UserForm anlegen.
Gruß
Rudi