AW: hast Du Blattschutz auch deaktiviert ? oT
07.12.2010 11:18:47
Pascal
Hier mal den Code den ich bisher habe. Ich glaube das Problem liegt darin, dass das Autofill hier wieder alles überschreibt ?
Private Sub CommandButton1_Click() 'Formeln runterkopieren
On Error Resume Next
ActiveSheet.Unprotect "0000"
Dim x As Long, y As Long, j As Long
Dim MyDatStrg As String
MyDatStrg = InputBox("Bitte Datum angeben", "Datum", Date)
If StrPtr(MyDatStrg) = 0 Then Exit Sub 'Abbrechen gedrückt
If Not IsDate(MyDatStrg) Then Exit Sub 'Kein Datum
x = Cells(Rows.Count, 10).End(xlUp).Row
y = Cells(Rows.Count, 1).End(xlUp).Row
For j = x + 1 To y
Cells(j, 10).Value = CDate(MyDatStrg)
Cells(j, 10).Interior.ColorIndex = 34
Cells(j, 11).Interior.ColorIndex = 6
Cells(j, 12).Interior.ColorIndex = 6
Cells(j, 13).Interior.ColorIndex = 6
Next
If x y Then Range(Cells(x, 11), Cells(x, 13)).AutoFill Destination:=Range(Cells(y, 11), _
Cells(x, 13))
ActiveSheet.Protect "0000"
End Sub