What is meant by DATA TYPE

     

  • DATA TYPE signifies what type of data that user can strore in VARIABLE
  •  

     

    DATA TYPE - Integer

     

  • This data type enables to store INTEGER values
  • Intead of INTEGER we can use %
  • Range is equal to -32,768 to 32,767
  •  

     

  • Result dispalyed in "Column A"
  •  

     

    DATA TYPE - String

     

  • This data type enables to store LETTERS,NUMBERS values(OR)
  •  

  • This data type enables to store ALPHANUMERIC Characters
  •  

  • Intead of STRING we can use $
  •  

  • Value of string should mention in DOUBLE QUOTES" "
  • We can strore Fixed length aswell as variable lengh strings
  •  

  • In fixed length we can store 0 to 65,400 characters
  •  

  • In variable length we can store 0 to 2 billion characters
  •  

     

  • Result displayed in range A1:A11
  •  

     

    DATA TYPE - LONG

     

  • Long Integer used for the number greater than Integer
  •  

  • Value ranges from -2,147,483,648 to 2,147,483,647
  •  

  • The ampersand (&) is the symbol for LONG
  •  

  • LONG is useful to mention ROWS whereas INTEGER is useful to mention COLUMNS
  •  

     

     

     

    DATA TYPE - DATE

     

  • DATE data type enable to store date and time values in variable
  •  

  • Date value must be assigned in between: either " " or #
  •  

  • Range of Date is Jan 1, 100 to 12/31/999
  •  

    Convert String to Date

  • Result = CDate(Value to Convert)
  •  

     

     

     

    DATA TYPE - CURRENCY

     

  • This data type is useful when user want's to store currecy value in variable
  •  

  • It store 15 digits from left and 4 digits from right
  •  

  • Value lies between range of -922,337,203,685,477.5808 to 922,337,203,685,477.5807
  •  

  • Symbol for currency date type is @
  •  

     

     

    DATA TYPE - BYTE

     

  • This data type is used to store postive integer
  • Range is 0 to 225
  • It don't accept negative values
  • It don't accept value greater than 255
  •  

     

     

    DATA TYPE - BOOLEAN

     

  • This data type denotes only two possible values
  • (i) True

    (ii) False

     

    DATA TYPE - VARIANT

     

  • Variant data type inclusive of:
  •  

    • Date
    • Integer
    • String
    • Null Values

     

  • If user not mentioned any data type, excel considers that VARIABLE as VARIANT by default
  •  

     

     

    DATA TYPE - Byte

     

  • It is smallest Data type
  • It allows to store integer values from 0 - 255
  • It doesn't allow negative values
  •  

     

    DATA TYPE - DOUBLE

     

  • It enables to store floating point numbers
  •  

  • 1.2524, -1.23524, it allows both positive and negative values
  •  

    DATA TYPE - - - - OBJECT

     

  • In this case VARIABLE refers to valid OBJECT
  •  

  • In VBA we can find below mentioned objects
  •  

     

    How to define a OBJECT VARIABLE

     

  • We need to follow below mentioned two steps
  •  

  • While assigning value to the object use SET key word
  •  

    • Declare a Variable
    • Assign a value to the declared variable
    •  

  • While assigning value to the object use SET key word
  •  

    RANGE OBJECT - - Declaration

     

    • First Declare a Variable
    • Second Assign a value to the declared variable
    • Third = usage of variable
    •  

     

     

    Another Example:

     

     

     

    How to Nullify the Object