Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub LiveDemo()
- Dim result As String
- result = NumAsText(324)
- Debug.Print result
- End Sub
- Function NumAsText(num As Integer)
- If num = 1 Then
- NumAsText = "one"
- ElseIf num = 2 Then
- NumAsText = "two"
- ElseIf num = 3 Then
- NumAsText = "three"
- ElseIf num = 4 Then
- NumAsText = "four"
- ElseIf num = 5 Then
- NumAsText = "five"
- ElseIf num = 6 Then
- NumAsText = "six"
- ElseIf num = 7 Then
- NumAsText = "seven"
- ElseIf num = 8 Then
- NumAsText = "eight"
- ElseIf num = 9 Then
- NumAsText = "nine"
- Else
- NumAsText = "not a digit"
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement