Jack Nouws
Terugkerende gebruiker
- Lid geworden
- 16 apr 2008
- Berichten
- 1.396
Hallo
Ik ben met een stukje code bezig maar ik krijg het niet werkend.
Het gaat om het stukje autofill Wie kan me hierbij helpen?
Met vr gr
Jack
Ik ben met een stukje code bezig maar ik krijg het niet werkend.

Het gaat om het stukje autofill Wie kan me hierbij helpen?
Met vr gr
Jack
Code:
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
Else
If TxtNr <> "" Then
With Sheets("dataplant").[C2:C200]
Set c = .Find(CboCode.Value, LookIn:=xlValues, LookAt:=xlWhole)
Cells(c.Row, "A").Resize(, 9) = Split(Format(TxtDatum.Text, "mm/dd/yyyy") & "|" & TxtNr.Text & "|||" & TxtVN.Text & "|" & TxtTV.Text & "|" & TxtAN.Text & "|" & TxtMaat.Text & "|" & TxtPot.Text, "|")
[COLOR="blue"]With .Cells(c.Row, "B").Resize(, 3)
.AutoFill Destination:=.Resize(2)
End With[/COLOR]
End With
' .Protect
' End With
End If
End If
Application.ScreenUpdating = True
End Sub