![]() In the next step, I have applied FOR loops to insert assigned numbers to the array in the first column. ![]() Later I have declared one more variable called “I” this is the second type of a variable and holds the data type of integer. X(2) = 25 means the second variable should be equal to the value of 25 and so on. X(1) = 20 means the first variable should be equal to the value of 20. This means variable x will hold 5 different types of values.ĭim x(1 To 5) As Long, i As Integer End SubĪfter that, I have assigned the values to each variable. But while declaring the variable itself, I have opened the bracket and mentioned 1 to 5. A variable name is x, and the data type is LONG. But if I want to insert 5 consecutive numbers by using the single variable, I need to use the type array variable, which can hold many variable values in a single variable name. In the above example, x holds only one variable that’s all. ![]() Now run the code using the F5 key or manually to see results. The x value is equal to 1, and in the range, A1 the value will be inserted as the value of x, i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |