Hi,
I am creating an inputbox where I can add the client number manually with 11 digits, but it is not working properly:
1. When I click on OK without adding anything, it will shows up the MsgBox, but I want it to reload it back so I can input it. May be loop until 11 digits is entered?
2. When I click on cancel, instead of just exiting, a MsgBox will appear by showing "Client's Number must have 11 digits!"
What should be amended?
Thanks
ClientInput.xlsmSub InputClient()
Dim ClNum As Variant
ClNum = Application.InputBox("Please input the Client Number (11 digits)", "Manual Client Input")
If Not (ClNum) Like "###########" Then
MsgBox "Client's Number must have 11 digits!", , ""
If ClNum = False Then Exit Sub 'User cancelled
Else
wsSheet1.Range("A1").Value = ClNum
End If
End Sub
Bookmarks