Results 1 to 6 of 6

Thread: Solved: if odd even numbers

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    VBAX Newbie
    Joined
    Sep 2016
    Posts
    2
    Location
    Public Function IsEven(ByVal Number As Long) As Boolean
        IsEven = (Number Mod 2 = 0)
    End Function
    
    Public Sub findEvenOdd()
    Dim x As Integer
    x = InputBox("Please enter the number")
    If IsEven(x) Then
    MsgBox "The Number is the Even Number"
    Else
    MsgBox "The Number is the Odd Number"
    End If
    End Sub
    Last edited by Aussiebear; 09-06-2016 at 02:43 AM. Reason: Added code tags to post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •