Stan, thank you so much for doing that, it's fantastic!
It's such an elegant (if VBA can be described that way) solution to the problem and a dynamic approach that I've never understood before. I expect to many seasoned VBA guys it's second nature, but I feel like a light bulb has come on haha.
I hadn't realised that the array can be populated by simply stating a = Range("A2:H" & lr) and conversely written back by to the cells in the same manner. I also thought that the array sizes had to be declared initially rather than declaring the arrays as variant. This really helps me to understand their use in simplifying some of my convoluted coding.
ReDim is something that I haven't come across before so I will read up on that too.
One thing from my basic understanding of arrays is that by default they start from position 0 unless specified, like in your ReDim line for array 'b'.
Does the 'a' array run from 0-7 and not 1-8? I had thought that the Ubound function also counted from position 0?
I assume they mustn't do because the loops cycle through the arrays without missing the last column when they both use 'ii' variable as the position across the array.
Again, thank you very much for taking the time to help me understand this, I really appreciate it and have learned a awful lot from this one thread.
Chris
Bookmarks