Advertisement
veronikaaa86

Num In Range & Password

Sep 20th, 2022
2,340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub NumInRange()
  2.     Dim num As Integer
  3.     num = CInt(InputBox("Enter valid number!"))
  4.    
  5.     '1 - 100
  6.    Do While num < 1 Or num > 100
  7.         num = CInt(InputBox("Enter valid number!"))
  8.     Loop
  9.    
  10.     MsgBox "The number is: " & num
  11.    
  12. End Sub
  13.  
  14. Sub Password()
  15.     Dim validPassword, inputText As String
  16.     validPassword = "s3cr3tPassw0rd"
  17.     inputText = InputBox("Enter password!")
  18.    
  19.     Do While inputText <> validPassword
  20.         inputText = InputBox("Enter password!")
  21.     Loop
  22.    
  23.     MsgBox "Welcome"
  24.    
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement