Created
September 26, 2011 21:38
-
-
Save jeffreyiacono/1243483 to your computer and use it in GitHub Desktop.
Excel VBA user defined function sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function tell_if_odd_or_even(num As Integer) As String | |
Dim parity As String | |
If num Mod 2 = 0 Then | |
parity = "even" | |
Else | |
parity = "odd" | |
End If | |
tell_if_odd_or_even = num & " is " & parity & "!" | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment