Hi Dave,
Rather than try and re-invent the wheel with a userform and command buttons, just use the standard Message and Input boxes.
Call the following procedure from your workbook open event.
Sub GetReference()
Dim st As String, lRow As Long
If MsgBox("Do you have a reference", vbYesNo, Title:="Before you begin") = vbNo Then
Sheet1.Range("B2") = "Not Applicable"
Else
st = InputBox("Please enter your reference")
On Error Resume Next
lRow = Sheet2.Range("A:A").Find(What:=st).Row
If lRow = 0 Then
MsgBox "Please re-enter your reference"
End
Else
Sheet1.Range("B2") = st
End If
End If
End Sub
Regards
Bookmarks