Private Sub CommandButton1_Click()Call viewbydateIf Cells(h8) <> Cells(h7) Then MsgBox "A matter number has beenrecorded twice"End Sub