VBA Programming - Data Types, Variable Scopes, and Debugging Shortcuts

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

Double

High-precision floating point (15-6 digits) data type used in VBA for calculations involving decimal numbers.

ex: 3.14159265358979

2
New cards

Single

Lower-precision floating point (7 digits)

ex: 3.14

3
New cards

Integer

Whole numbers from -32,768 to 32,767 (ex: 42)

4
New cards

Long

Larger integers (-2B to 2B)

ex: 1000000

5
New cards

String

Text

ex: “Hello”

6
New cards

Boolean

Logical values (ex: True / False)

7
New cards

Currency

Fixed-point with 4 decimal places

ex: 1234.5678

8
New cards

Date

Date/time values

ex: #9/22/2025#

9
New cards

Variant

Generic and default - takes any type (not recommended unless needed); ex: 5 or “text”

10
New cards

Range

Refers to Excel cell(s); ex: Range(“A1”)

11
New cards

Local

Inside a sub/function that only the active procedure can use (ex: Dim or Static)

12
New cards

Module-Level

At the top of a module (outside procedures); used by any sub or function in that module (ex: Dim)

13
New cards

Global

At the top of a module, accessible across all modules; used by entire workbook

ex: Public

14
New cards

Step Into

Executes the current line and enters into called procedures or functions.

keys: F8

15
New cards

Step Over

Executes the current line without entering any functions it calls.

Keys: Shift + F8

16
New cards

Step Out

Finishes the current function/sub and returns to the caller.

Keys: Ctrl + Shift + F8

17
New cards

Run to Cursor

Executes everything up to the line where your cursor is.

Keys: Ctrl + F8

18
New cards

Run to Breakpoint

F5

19
New cards

Add Watch

When the expression becomes true, VBA pauses execution

Steps: Debug → Add Watch

20
New cards

Add Breakpoint

The program will run until it reaches that line, then pause.

Click in margin or press F9

21
New cards

View Locals Window

View → Locals Window