Personally, I would use a commandbutton on my userform, and use its click event:
Private Sub CommandButton1_Click()
With Worksheets("Main")
If Application.CountIf(.Range("C:C"), Me.TextBox1.Text) = 0 Then
.Range("C" & .Rows.Count).End(xlUp)(2).Value = Me.TextBox1.Text
Else
MsgBox "That's already there...."
End If
End With
Me.TextBox1.Text = ""
Me.TextBox1.SetFocus
End Sub
Though you could probably use this in place of your code
Sub CopyToCell()
With Worksheets("Main")
If Application.CountIf(.Range("C:C"), UserForm2.TextBox1.Text) = 0 Then
.Range("C" & .Rows.Count).End(xlUp)(2).Value = UserForm2.TextBox1.Text
End If
End With
UserForm2.TextBox1.Text = ""
UserForm2.TextBox1.SetFocus
IsActive = False
End Sub
Bookmarks