Private Sub CommandButton1_Click()
With TextBox1
If Not .Text Like "[0-9][0-9][0-9][0-9] [A-Z][A-Z]" Then
MsgBox "Invalid"
End If
End With
End Sub
Take Andrew's code and swap the name of the textbox with the name you mention in the OP.I am not sure if i understand what you mean by that Andrew but i guess this is why i posted that it's from a userform.
Private Sub CommandButton1_Click()
With txtPostcd
If Not .Text Like "[0-9][0-9][0-9][0-9] [A-Z][A-Z]" Then
MsgBox "Invalid"
End If
End With
End Sub</pre>
So you have a userform.no matter what or where, i keep getting "invalid"
With Userform1.txtPostcd
</pre>