Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. strVar = InputBox("Enter the Key")
  2. Set objReg = New RegExp
  3. objReg.Pattern="^[a-zA-Z][0-9]{3}$" 'If you want only the capital letters, you can rewrite the pattern as ^[A-Z][0-9]{3}$
  4. If Not objReg.Test(strVar) Then
  5. MsgBox "Input is incorrect!!!"
  6. Else
  7. MsgBox "Input is correct"
  8. End If
  9. Set objReg = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement