![]() ![]() You can also grab values from a worksheet and save them to an array. The index number in the pets variable tells excel where to save the value in the array. In this macro 2 values can be stored pets(1 to 2). You can assign values to an array in your macro or user defined function. You are probably going to use one or two dimensions most of the time. The example arrays shown above have one dimension but it is possible to have up to 60000 dimensions. ![]() Note that this clears all previous saved array values. You can also change the amount of values an array variable can store any time in the macro, using the ReDim statement. This variable can store 5 values, 1 to 5. If you want to start with 1 instead of 0 you can do that too. The macro below declares variable pets as a string array, it can store 6 values. You can also specify how many values you want to store in the array. ![]() The parentheses shows that this is an array variable. The following line declares pets as a String array variable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |