Chapter 7 Flashcards

1
Q

When are apostrophes ignored as comment indicators in Excel VBA?

A

When they are contained within a set of quotation marks

(e.g. Msg = “Can’t continue”)

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

Quick way to convert a block of statements into comments

A

From the VBE:

View->Toolbars->Edit

Select group of statements and click the Comment Block button

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

The first character of a variable must be a _____.

A

letter

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

Does VBA distinguish between uppercase and lowercase letters in variables?

A

No

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

Cannot use these characters in a variable name

A

, $, %, &, !

spaces

periods

math operators

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

Letting VBA handle your data typing results in these two issues

A

slower execution

inefficient memory use

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

To get a slight performance increase use this instead of Integer for variable type

A

Long

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

What is the default data type?

A

Variant

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

What is the data type Variant?

A

changes type depending on what you do with it

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

Use this statement as the first statement in code to force declaration of all variables

A

Option Explicit

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

One benefit of using Option Explicit as first line

A

mis-spelled variables will be identified as not being typed

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

Press this after typing the first two or three characters of a variable or reserved word or function to get selection list or auto-completion

A

Ctrl+space bar

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

Example of dimensioning a variable

A

Dim YourName as String

Dim January_Inventory as Double

Dim RowNumber as Long

Dim X

(X is treated as a Variant)

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