In the sample it is working fine. I changes the code a bit and made a sheet whit a nice looking collers and rows. Now the code is not working anymore.
This is de code where it is going wrong. I dod nothing to fancy. Only toke the first 3 line for some headers!
nRow = .Range("C" & .Rows.Count).End(xlUp).Offset(1).Row
Private Sub CommandButton1_Click()
Dim check As Boolean, nRow As Long
check = True
For i = 1 To 25
If Me("ComboBox" & i).Value = vbNullString Then check = False
Next
For j = 2 To 3
If Me("TextBox" & j).Text = vbNullString Then check = False
Next
If check Then
With LF_wissel_rapport
nRow = .Range("C" & .Rows.Count).End(xlUp).Offset(1).Row
If nRow < 2 Then nRow = 2
For i = 1 To 25
.Cells(nRow, i + 1) = Me("Combobox" & i).Value
Next
.Cells(nRow, 27) = TextBox1.Text: .Cells(nRow, 28) = TextBox2.Text: .Cells(nRow, 29) = TextBox3.Text
End With
Else
MsgBox "Niet alle verplichte velden zijn ingevuld !"
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Bookmarks