From the course: Excel: Learning VBA
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Introduce Excel VBA data types - Microsoft Excel Tutorial
From the course: Excel: Learning VBA
Introduce Excel VBA data types
- [Instructor] When you create programs using Excel VBA, you can define variables and assign each of those variables a type. In this movie, I will list and describe the variable types that are available to you. To start, we'll look at the byte data type, and that is a very small number that goes from zero to 255. So you have eight bits or zeros and ones and two to the eighth is 255. You can also have what's called a Boolean value and that can be true or false. True is represented as a one and false is represented as a zero. And integer is a number from negative 32,768 to positive 32,767. And those two numbers are different on the positive and negative side because you have to include zero. Integers are by far the trickiest data type to work with because you assume that most numbers can fit into an integer when in fact they can't. It only goes up to 32,767. So you can use integers, but make sure that your numbers…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Introduce Excel VBA data types4m 5s
-
(Locked)
Declare variables and require declaration before use5m 27s
-
(Locked)
Manage variable scope3m 50s
-
(Locked)
Define static variables and constants5m 42s
-
Create a calculation using mathematical operators5m 10s
-
(Locked)
Define arrays7m 10s
-
Define and use object variables3m 3s
-
(Locked)
Streamline code references using With…End With statements4m 40s
-
(Locked)
Challenge: Define variables, constants, and calculations2m 5s
-
(Locked)
Solution: Define variables, constants, and calculations3m 13s
-
(Locked)
-
-
-
-
-
-