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

Introduction to VBA editor
G

Gagan G.

0 0
0

Arrange and View Multiple Worksheets at Once in Excel
Arrange and View Multiple Worksheets at Once in Excel This feature allows you to view multiple worksheets at once from the same workbook at the same time. You need to follow beneath simple...

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....

Rand() Function
Purpose: Get a random number between 0 and 1. Return Value: Any decimal number between 0 and 1. Syntax: =RAND() Usage: RAND() function will returns a number between 0 and 1. For example, = RAND()...

VBA Function - INSTR
INSTR works similar to FIND function in Excel. INSTR search for specific text in a given text and returns the position number of what you are searching for. Syntax: InStr( , string, searchingfor, ) Sub...
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