Hi,

Can someone help me with this piece of code: There is a input box where the user types something. It has to be 5 characters long, if it isn't it displays the message then loops. However its not working. The debugger is picking up that what is entered is 5 chars but does just throws an error. Anyone help?

Thanks
John

EnterTeamNo:
        tmn1 = UCase(Application.InputBox("Enter your Team Number", "Team Number"))

        If tmn1 = False Then
            Exit Sub
        ElseIf Len(tmn1) = 5 Then
            GoTo ClrData
        Else
            MsgBox "Invalid Format", 48, "Error!"
            GoTo EnterTeamNo
        End If