Advertisement
veronikaaa86

04. Nums 1 to 9

Sep 13th, 2022
1,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub LiveDemo()
  2.     Dim num As Integer
  3.     num = Range("A1")
  4.    
  5.     If num = 1 Then
  6.         Debug.Print "one"
  7.     ElseIf num = 2 Then
  8.         Debug.Print "two"
  9.     ElseIf num = 3 Then
  10.         Debug.Print "three"
  11.     ElseIf num = 4 Then
  12.         Debug.Print "four"
  13.     ElseIf num = 5 Then
  14.         Debug.Print "five"
  15.     ElseIf num = 6 Then
  16.         Debug.Print "six"
  17.     ElseIf num = 7 Then
  18.         Debug.Print "seven"
  19.     ElseIf num = 8 Then
  20.         Debug.Print "eight"
  21.     ElseIf num = 9 Then
  22.         Debug.Print "nine"
  23.     Else
  24.         Debug.Print "not a digit"
  25.     End If
  26. End Sub
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement