UrbanPro
true

Learn Microsoft Excel Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Variant Datatype: Excel/Access/Office VBA

Punit Kumar
05/09/2017 0 0

The Variant data type is the data type for all variables that are not explicitly declared as some other type. The Variant data type has notype-declaration character.

A Variant is a special data type that can contain any kind of data except fixed-length String data. A Variant can also contain the special valuesEmpty, Error, Nothing, andNull. We can determine how the data in a Variant is treated using the VarType function or TypeName function.

We can assign any value at any time within a single module/program. If we don't declare the data type of any variable then it automatically declare as variant data type:

Sub modVariant1()
Dim VData as variant
VData =1234

Msgbox vData
vData="Aman"
Msgbox vData
End Sub

Sub modVariant2()
'In this example, data type is not declared
Dim VData
VData =1234

Msgbox vData
vData="Aman"
Msgbox vData
End Sub

0 Dislike
Follow 3

Please Enter a comment

Submit

Other Lessons for You

VBA Tip: Repeating Emp Names N number of times using 4 different loops
Hi All,This is a requirement from one of our student and here we are posting the question along with solution (this can be achieved using 4 different loops). In Column “J” there are few employee...

Before analysis start Important
Hi All, Often we do analysis in day to day life, before we start we should follow few principles of data cleaning activities in any application such as removing unwanted space, converting data into correct...

Range Selections
G

Gagan G.

0 0
0

What is save workspace?
Its an option in excel that help you to save a shortcut in particular place (may be your desktop). When you double click to open this shortcut it opens all the related excel files together from different...

X

Looking for Microsoft Excel Training Classes?

The best tutors for Microsoft Excel Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Microsoft Excel Training with the Best Tutors

The best Tutors for Microsoft Excel Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more