Step 1) Like, in the previous tutorial, we will insert the commandButton1 in our Excel sheet. In this example, we will declare three types of variables string, joining date and currency. Let see an example, on how to declare variables in VBA. These are the major data types in the Visual Basic. In VBA, if the data type is not specified, it will automatically declare the variable as a Variant. An object type variable needs 4 bytes in 32-bit computer and 8 bytes on a 64-bit computer for memory allocation.Ī string type data can hold string values which include 0 to 2 billion Unicode characters. If you declare a variable in Object type, it can hold any type of data. The storage space is same as double type. It needs 8 bytes in memory.Īn integer type variable can store values ranging from -2,147,483,648 to 2,147,483,647. It can hold more range values than integer type, also supports values with decimal points. It stores the values with up to 28 digits after the decimal point. The char type allocates 2 bytes in memory and can store values from o to 65535.Ī date type is used to declare a variable as a date. VB supports the boolean data type which stores only two boolean values true(1) or false(o).Ī byte data type stores the values from 0 to 255 with 1-byte storage allocation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |