Welcome to the Forum anonymous12!
If you are getting a NAME error then you probably do not have the function declared in the correct place. You should have it declared as public in a generic module (like Module1) and not in a worksheet module (like Sheet1).
Second, I see another problem in your Function declaration. ParamArray is not a way to declare that an argument is an array. It is a way to show that a function can be called with a series of any number of arguments that can be treated as an array. A example of this is the SUM function. But that is not what you have. You have two arguments that are arrays. They should be declared without ParamArray.
But. You are passing in Ranges, not arrays. So your function should work with Ranges.
Your code should look like this, which I have tested. This will return a #COUNT! error if the two ranges do not have an equal number of cells.
Bookmarks