VBA (Sum of Absolute Difference) Ranges
<p>Write a function that takes 2 ranges or 2 arrays as input and gets the sum of absolute difference of every element if these two ranges/arrays have the same numbers of elements or send error message to user if the sizes of these two arrays/ranges are not the same. This is a VBA problem and I am having a rough time.</p>

<p>This is what I have so far:</p>

<pre><code>Public Function MyFunction(Rng1 As Range, Rng2 As Range)
    Dim CountRng1 As Long
    Dim CountRng2 As Long

    Rng1.Count = CountRng1
    Rng2.Count = CountRng2

    If CountRng1 = CountRng2 Then

    Else
        MsgBox "Error, the ranges you passed to the function are not the same size"
    End If
End Function
</code></pre>