What is a Nested If Statement in Excel VBA (Macros) - Code Included
5.4 هزار بار بازدید -
8 سال پیش
-
Grab the Free VBA Quick
Grab the Free VBA Quick Reference Guide
https://www.chrisjterrell.com/excel-v...
A nested if statement is an if statement within another if statement. It allows you to execute mutiple criteria. If you are learning VBA understanding this concept is a life saver.
CODE:
===============
Sub NestedIf()
mbox = MsgBox("Can I ask you a Question?", vbYesNo)
If mbox = vbYes Then
i = InputBox("How Old are you")
If i _ 35 Then
MsgBox "You are Old"
Else
MsgBox "You are a young"
End If
End If
End Sub
https://www.chrisjterrell.com/excel-v...
A nested if statement is an if statement within another if statement. It allows you to execute mutiple criteria. If you are learning VBA understanding this concept is a life saver.
CODE:
===============
Sub NestedIf()
mbox = MsgBox("Can I ask you a Question?", vbYesNo)
If mbox = vbYes Then
i = InputBox("How Old are you")
If i _ 35 Then
MsgBox "You are Old"
Else
MsgBox "You are a young"
End If
End If
End Sub
8 سال پیش
در تاریخ 1395/04/13 منتشر شده
است.
5,442
بـار بازدید شده