I'm new on this forum and to VBA altogether, so forgive me if I mess something up.
I am working on creating a new matrix raised to a power function that gets called in the worksheet. I have looked around on different forums and found a good basis, but I'm running into something that seems to be unique to my circumstance.
What will happen, is the user will call =POWERMATRIX("Input Range", "Input Power"). The Input Range is given a name in the worksheet, called "Count". Count must always be a square matrix (otherwise you can't raise it to a power). When the entire Count range is continuous and all together, one solid square in the worksheet, everything works fine, I'm golden. However, when Count is discontinuous and has 2 or more areas, I run into issues.
What I'm trying to do is take each area of the Input Range and union them together into a single range, with one Area, so that I can get the function to work.
This latest iteration is what I've got. I've tried tons of things, but nothing seems to work.
Formula:
Please Login or Register to view this content.
I don't know if I need to call finalRng as a variant, or if I need to resize it, or what. I've tried each, but I must not be doing the syntax correctly on something.
In summary, I need to be able to join multiple areas of a range into a single range of 1 area. Help?
Bookmarks