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

Why Option Explicit is Required in the VBA Editor
Hi Folks,Do you know Excel VBA Editor has functionality where you don't need to declare a variable in memory (DIM).But what will happen if you write a program without declaring a variable nothing happens?Then...

Advanced Excel and VBA concept
In this video, learn about Advanced Excel: - Data Input and Hidden Features, - Worksheet Navigation, - Excel Formulas & Functions, - Data Cleaning and Formatting. VBA and its useful Built-in Functions,...

Nagadarshan

0 0
0

VBA Function -
Using FORMAT Function in VBA we can modify the format of Numbers, Dates, Times & String. Syntax: FORMAT(expression, format, , ) 1. Formatting "Numbers" using FORMAT function in VBA SUB Format_Numbers() MsgBox...

Excel Tip: Use Index Or Match Instead Of Vlookup Or Hlookup.
Hi, In today's Excel topic we will see how Index & Match function is superior than Vlookup/Hlookup. With Index and Match, the return value need not be in the same column as the lookup column, unlike...

MS Excel: Formulas and Functions: Listed by Category
MS Excel: Formulas and Functions: Listed by Category Worksheet formulas are built-in functions that are entered as part of a formula in a cell. These are the most basic functions used when learning Excel....
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