Let’s make the same program while we have two or three condition as given

 

Sub mySub()

Dim x, y As Integer

x = 80

y = 80

If x > y Then

MsgBox “X is Greater than Y”

ElseIf y > x Then

Msgbox “Y is Greater than X”

Else

Msgbox “Both are EQUAL”

End If

End Sub

author image

About admin

You Might Also Like...

VBA Hirdesh Bhardwaj, Hirdesh Bhardwaj Book
VBA For Excel Hirdesh Bhardwaj
JavaScript – Advanced Learning

1 Comment

  1. Simply wish to say your article is as astounding. The clarity in your put up is just great and i could assume you’re knowledgeable on this subject.
    Well with your permission let me to grasp your
    feed to keep up to date with drawing close post. Thanks one million and please continue the rewarding work.

Leave a Reply

Your email address will not be published.

Enjoy the tutorial? Please spread the word :)

Follow by Email
Facebook
Facebook
Google+2k
Google+
http://hirdeshbhardwaj.com/2017/04/04/vba-else-elseif-statement
YouTube82
YouTube