Lesson#10 Functions in VBA Flashcards

1
Q

What are the 3 types of functions you can use in VBA?

A

VBA Built-in, Excel Worksheet and User-Defined.

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

How do you use a VBA built-in function?

A

By calling it.

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

What types of arguments can you use when working with VBA built-in functions?

A

Named and Unnamed.

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

How do you separate an argument’s name from it’s value when working with named arguments? (VBA Built-in)

A

:=

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

What statement do you use to call a worksheet function?

A

Application.WorksheetFunction

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

What are function procedures commonly known as?

A

User-Defined Functions (UDFs)

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

What is the statement used for creating a UDF?

A

Function UDFName()
Statements
End Function

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

When creating a UDF what must you always do?

A

Assign a value, because name of UDF is also name of variable.

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

What is the statement used for assigning a data type to a UDF?

A

Function UDFName() As DataType

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

Where should you generally store a UDF?

A

Within a standard module

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

What are the 3 ways you can store a UDF?

A
  • Calling from another procedure.
  • Using a UDF in a worksheet/conditional formatting formula.
  • Calling UDF from VBE window.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is difference between a normal UDF and a volatile one?

A

Volatile functions are recalculated whenever a cell changes.

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

How do you mark a UDF as volatile?

A

By setting the Application.Volatile Method to True.

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

How do you create UDFs that return errors?

A

Use the CVErr built-in function to convert error numbers to real formula errors.

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