The following in a a code in Sub TestMacro If Cells (1,1)value 5 Then Cells(2,2)
ID: 3808963 • Letter: T
Question
The following in a a code in Sub TestMacro If Cells (1,1)value 5 Then Cells(2,2) Value Ten" Elself cells (1,1)value 5 Then Cells(2,2).Value Five Else Cells (2,2) Value- "Zero EndIf End Sub When running the macro, assume the value in cell A1 4. After the above macro code is run, what will the value in cell B2 be? When running the macro, assume the value in cell A1 3. After the above macro code is run, what will the value in cell B2 be? When running the macro, assume the value in cell A1' 5.After the above macro code is run, what will the value in cell B2 be?Explanation / Answer
1.
A1 = 4, B2 = Zero
2.
A1 = -3, B2 = Zero
3.
A1 = 5, B2 = Five
Sub TestMacro()
If Cells(1, 1).Value > 5 Then
Cells(2, 2).Value = "Ten"
ElseIf Cells(1, 1).Value = 5 Then
Cells(2, 2).Value = "Five"
Else
Cells(2, 2).Value = "Zero"
End If
ActiveCell.FormulaR1C1 = ""
ActiveWindow.Close
End Sub