What should you do to resize an array or dynamic vector in Excel?
Mainly we need to know that a dynamic vector is what we use when we are not sure that the data in a list will be durable, otherwise it can increase or decrease over time.
Although we recommend that you create the dynamic vector from the beginning of work; so that it is easier to resize it over time or as the elements that compose it increase.
Now, how should you create this vector so that you can resize it to your liking? Well, very simple, Excel lets you create it with the option of " Visual Basic «, We just have to create the array as we normally do.
We open a sheet with the command " Alt + F11 »And we have to start inserting the code, we will use as an example name for the array Family" Dim Family () as a string «.
We must leave the space between the brackets blank, so we cannot assign a dimension to the vector we are creating. You can use the best most useful keyboard shortcuts to use in Excel and speed up your work a bit.
Then we establish a dimension with the code " ReDim Family (1 to 5) as String «, This will establish a first dimension to our carrier which we can later modify.
Now, to resize an array or a dynamic vector, we have to insert a code that helps us to keep the previous data and insert the new ones, we will reach it through the code " ReDim Preserve Family (1 to 9) ", The importance of using this code with the word" preserve »Is that it will prevent the deletion of previous data.
With this combination of codes you can change the size of the array as many times as you want; always avoiding to create new unnecessary vectors that take up space and make it difficult to carry out activities.
How does it benefit us to have a dynamic vector that we can scale to our liking?
If we look closely at the market in which it is used Excel, in a certain sense, everything is linked to business administration; accounting or inventories, so it's easy to predict that everything we create with this tool may be subject to change.
Taking into consideration a company that wants to organize its customer portfolio, which can increase or decrease at any time, a dynamic vector is referred to as the most suitable option.
The expansion of a carrier tied to an exponentially growing inventory, as a company acquires new products, is also a good example to justify the use of this tool.
Also providing the ability to copy this vector and use it in any other document, like this once the vector allows us to have it as a reserve. We also highlight the ability to create vectors in our spare time that we can use for a large number of jobs.
How important is it to know how to resize an array or dynamic vector?
If we take into account that this option is included among those associated with a knowledge Advanced di excel; This takes us a little further when we offer our services to any company.
The knowledge of Excel is very popular today; This, coupled with the number of options and the ability to create a large number of tables, text sheets, indexes, graphs and an infinity of other qualities that make those who manage this tool are a great acquisition for any company.