Home / Expert Answers / Computer Science / 10-complete-in-excel-and-show-all-of-your-work-question-10-note-there-are-four-parts-to-pa213

(Solved): 10. Complete in Excel and show all of your work Question 10: NOTE: There are four parts to ...



10. Complete in Excel and show all of your work

Question 10:
NOTE: There are four parts to number 10.
- Question 10: Use the If...Then...EIseIf statement in VBA code for the

The If...Then...Elself Example 10
Sub Example10()
Dim x As Integer
\( x= \) InputBox(Enter an Integer Number. , Example 1

Contrast the Preceding Code Example \( 10 a \) To This Code Without the Elseif
Sub Example10a()
Dim x As Integer
\( x= \) InpDoes Reversing the Order of the Conditions Work? Example 10b
Sub Example10b()
Dim x As Integer
\( x= \) InputBox(Enter an In

- A sequence of Elselfs may end with a plain else (called a trailing Else)
- If none of the conditions were True, the stateme

Question 10: NOTE: There are four parts to number 10. - Question 10: Use the If...Then...EIseIf statement in VBA code for the conditions on the slide "The If...Then...ElseIf Example 10." - Question 10A: Write the code based on Example 10a and compare with Example 10 results. - Question 10B: Write the code based on Example 10b and compare with Example 10 and 10 a results. - Question 10C: Write the code based on Example 10c to include trailing else. - Note: Please run all codes to make sure all message boxes work properly. The If...Then...Elself Example 10 Sub Example10() Dim x As Integer InputBox("Enter an Integer Number. ", "Example 1", 100) If Then MsgBox "Your number is smaller than 1000." Elseif Then MsgBox "Your number is smaller than 2000." Elseif Then MsgBox "Your number is smaller than 3000." Elseif Then MsgBox "Your number is smaller than 4000." End If Contrast the Preceding Code Example To This Code Without the Elseif Sub Example10a() Dim x As Integer InputBox("Enter an Integer Number. ", "Example 1", 100) If Then MsgBox "Your number is smaller than 1000." End If If Then End If If Then MsgBox "Your number is smaller than End If If Then is smaller than 2000." MsgBox "Your number is smaller than End If End Sub If Ga2 Infnrmation Guctom fnr If Does Reversing the Order of the Conditions Work? Example 10b Sub Example10b() Dim x As Integer InputBox("Enter an Integer Number. ", "Example 1", 100) If Then MsgBox "Your number is smaller than 4000." Elseif Then MsgBox "Your number is smaller than 3000." Elseif Then MsgBox "Your number is smaller than 2000." Elseif Then MsgBox "Your number is smaller than 1000." End If - A sequence of Elselfs may end with a plain else (called a trailing Else) - If none of the conditions were True, the statement(s) after this Else will be executed Sub Example10c() Dim As Integer InputBox("Enter an Integer Number. ", Example 1, 100) If Then MsgBox "Your number is smaller than 1000." Elseif Then MsgBox "Your number is smaller than 2000." Elseif Then MsgBox "Your number is smaller than Elseif Then MsgBox "Your number is smaller than 4000." Else MsgBox "Your number is greater than or equal to 4000." End If


We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe