SHARE
TWEET

Untitled

a guest Jul 17th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top