Skip to content

Instantly share code, notes, and snippets.

@jeffreyiacono
Created September 26, 2011 21:38
Show Gist options
  • Save jeffreyiacono/1243483 to your computer and use it in GitHub Desktop.
Save jeffreyiacono/1243483 to your computer and use it in GitHub Desktop.
Excel VBA user defined function sample
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