How to Declare Variables in VBA Coding

preview_player
Показать описание
Declaring variables in VBA in Excel is one of those things that many people say isn't important. I haven't really decided where I fall on that subject yet, so I'm going to post this video about what variables are in VBA.

Some things to know about variables: they take the form of a few different types.

Strings: these are sets of characters

Boolean: this is a true or false statement. Like 1=1 is true. So that's a boolean.

date: pretty obvious this is a date.

integer or double or long: these 3 are all numbers but they are different kinds of numbers. An integer is a number without a decimal. It's a whole number. Long and double have decimals attached to them. So 1.5 can be long or double, but if you make 1.5 an integer it will round up to 2.

As always, I do coding work and financial analysis for a living, so if you need help check out these links:

To book me to work on your financial projects or analysis, go here:

To follow my company on facebook go here:

To subscribe for more videos like this, go here:
Рекомендации по теме
Комментарии
Автор

Great explanations !  You may be the only You Tube Excel 'Teacher' who knows the true meaning if Dim.  Thank you

robertlohman
Автор

What will be vba constant for 10 digit mobile number
"long" doesn't work

deveshmaheshwari
Автор

What for 'Long' and 'variant' used for

Mmaheeshttoorggal
join shbcf.ru