Eintrag rot und Tabellenschutz
04.05.2009 07:58:28
Tino
Hallo,
ich würde dies so machen.
Passwort musst Du natürlich im Code anpassen. (bei mir mal "xxx")
Private Sub CommandButton1_Click()
Dim LRow As Long
With Tabelle1
LRow = .Range("A:E").Find("*", , xlValues, 2, 1, 2, False, False).Row
If LRow > 1 Then
.Range("A:E").Rows(LRow).Interior.ColorIndex = xlColorIndexNone
End If
LRow = LRow + 1
.Cells(LRow, 1).Value = Kunde.Value
.Cells(LRow, 2).Value = Betreuer.Value
.Cells(LRow, 3).Value = TXT_Datum.Value
.Cells(LRow, 4).Value = TXT_Zeit.Value
.Cells(LRow, 5).Value = Einträge.Value
.Range("A:E").Rows(LRow).Interior.ColorIndex = 3
MsgBox "DATEN wurden gespeichert!!"
Kunde.Text = ""
Betreuer.Text = ""
TXT_Datum.Text = ""
TXT_Zeit.Text = ""
Einträge.Text = ""
End With
End Sub
Private Sub UserForm_Initialize()
Tabelle1.Protect "xxx", , , , True 'Tabelle schützen mit UserInterfaceOnly auf True
End Sub
Gruß Tino