I have created a simplified Userform for you to study.
Private Sub CommandButton1_Click()
If TextBox1.Text = "" Then Exit Sub
On Error Resume Next
Set Z = Columns(1).Find(TextBox1.Value)
On Error GoTo 0
If Z <> TextBox1.Text Then Exit Sub
For Question = 1 To 3
Me.Controls("OptionButton" & Question * 3) = True
Me.Controls("OptionButton" & Question * 3) = False
Pos = Application.Match(Cells(Z.Row, Question * 2 + 5).Value, Array("", "Ja", "Nee", "N. V. T"), 0)
If Not IsError(Pos) Then Me.Controls("OptionButton" & Question * 3 - 4 + Pos).Value = True
Next
End Sub
Private Sub CommandButton2_Click()
If TextBox1.Text = "" Then Exit Sub
On Error Resume Next
Set Z = Columns(1).Find(TextBox1.Value)
On Error GoTo 0
If Z <> TextBox1.Text Then Exit Sub
For Question = 1 To 3
If Me.Controls("OptionButton" & Question * 3 - 2).Value = True Then Ans = "Ja"
If Me.Controls("OptionButton" & Question * 3 - 1).Value = True Then Ans = "Nee"
If Me.Controls("OptionButton" & Question * 3).Value = True Then Ans = "N. V. T"
Cells(Z.Row, Question * 2 + 5).Value = Ans
Next
End Sub
Bookmarks