Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
If TxtNr = "" Then
With Sheets("dataplant")
.Unprotect
.Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, 9) = Split(Format(TxtDatum.Text, "mm/dd/yyyy") & "|" & TxtNr.Text & "|||" & TxtVN.Text & "|" & TxtTV.Text & "|" & TxtAN.Text & "|" & TxtMaat.Text & "|" & TxtPot.Text, "|")
With .Cells(Rows.Count, 2).End(xlUp).Resize(, 3)
.AutoFill Destination:=.Resize(2)
End With
' .Protect
End With
[COLOR="RoyalBlue"] Else
Sheets("dataplant").[C2:C10].Find(CboCode.Value).Offset(, -2).Resize(, 9) = Split(Format(TxtDatum.Text, "mm/dd/yyyy") & "|" & TxtNr.Text & "|||" & TxtVN.Text & "|" & TxtTV.Text & "|" & TxtAN.Text & "|" & TxtMaat.Text & "|" & TxtPot.Text, "|")
[COLOR="RoyalBlue"]Sheets("dataplant").Range("B2", Range("B65536").End(xlUp)).FillDown
Sheets("dataplant").Range("C2", Range("C65536").End(xlUp)).FillDown
Sheets("dataplant").Range("D2", Range("D65536").End(xlUp)).FillDown[/COLOR]
End If[/COLOR]
Application.ScreenUpdating = True
End Sub