Hello Hello esbencito,
After downloading the workbook from your previous post and reviewing it, the macro I posted will not work and is inadequate for the task. I do have a couple of questions.- Which sections besides the "Clusters" will be updated ?
- Will the output be going to the sheet named "Desired Result" ?
VBA does support jagged arrays. When checking for duplicates it is better to use either a Collection object or Dictionary object. My preference is to use a Dictionary since no additional coding is needed to check if a key already exists or returning a list of all keys or all items. In VBA a jagged array is simply a 1-D array that holds an array in each element. An array can be resized dynamically in VBA but only the last dimension of the array can be changed. Using a Dictionary with large amounts of data allows a quick check for duplicates in a jagged arrays. Using big O notation to compare lookup times, the dictionary is O(1) constant time complexity while just iterating through the primary array to check for duplicates results in O(n) linear time complexity,
Example of Jagged Array
Bookmarks