Lesson#11 Control Code Execution and Conditional Execution of Statements Flashcards

1
Q

What is the GoTo statement?

A

It allows your code to go to a specific statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the basic statement structure for a GoTo Statement?

A

GoTo Label

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you distinguish between numeric and text tables in a procedure?

A

Text labels are followed by a :.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What two rules must labels follow in VBA code?

A

Begin at first character of line of code and cannot be indented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the If…..Then statement work?

A

Executes a set of statements if a condition returns True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the structure for a If….Then statement?

A

If Condition Then
Statements ToExecute
End If

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the If…..Then…..ElseIf…..Else statement work?

A

Carries out several conditions and executes depending on condition that returns True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the Else statement do in a If……Then…..ElseIf……Else statement do?

A

Executes if none of the above conditions are met.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does a Select Case statement work?

A

Uses a test expression to decide which set of statements to execute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the structure for a Select Case statement?

A
Select Case TestExpression
    Case Expression#
          StatementsCase1
     Case Else
           ElseStatements
End Select
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
What are the 3 steps executed in a Select Case statement?
Select Case TestExpression
    Case Expression#
          StatementsCase1
     Case Else
           ElseStatements
End Select
A
  1. VBA matches TestExpression to each expression within the expression list.
  2. Once VBA finds a matching case, it executes all the corresponding statements.
  3. If TestExpression does not match a case, VBA executes Else statement.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you specify a group of several individual conditions or situations under a single case?

A

Using (,), the To or the Is keyword.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly