Ferienplanung mit VBA
23.12.2004 07:23:02
Dimitri
ich bin daran eine Ferienplanungsliste zu erstellen, mit der man über Buttons die Abwesenheiten eintragen kann. Dazu habe ich mit Eurer hilfe folgenden VBA-Script (Makro) generiert. Eigentlich funktioniert es einwandfrei, doch sobald ich den Blattschutz einschalte, kann ich das Makro nicht mehr ausführen. Meine Frage ist, wie muss ich das Makro abändern, das es trotz Blattschutz ausgeführt werden kann.
Sub FillCells(strValue As String)
Dim objCell As Object
For Each objCell In Selection
objCell.Value = strValue
Next objCell
End Sub
Private Sub CommandButton2_Click()
' Ferien05 Makro
' Makro am 06.10.2004 von Vassaras Dimitri aufgezeichnet
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
FillCells ("F")
Selection.Font.ColorIndex = 3
End Sub