P
PBezucha
Hi sages,
Just for having weekend fun. Let's for simplicity have a UDF with two
variant/ranges arguments. If the dimension of the second (distant) one
differs from that of the first, calculation error in the function should be
trapped and therefore registered by means of MsgBox. In the moment, however,
when a user tries to select the second of range-inputs by dragging, even
pointing at the first cell of this range is immediately accepted and, due to
trapped error messages, the input obstinately fails. With difficulties two
cells can be selected at once but nothing more. The user must shift the
"dragging" selection to upper input line or type down the whole range address
in the input box manually. How would a professional (especially the most
valuable one) build the macro so that the UDF would be more user friendly?
For elucidation of the problem:
Function RangesDifferent(A, B) As Boolean
If A.Count <> B.Count Then
MsgBox "Dimensions of ranges differ"
RangesDifferent = True
End If
End Function
With all regards and thanks
Just for having weekend fun. Let's for simplicity have a UDF with two
variant/ranges arguments. If the dimension of the second (distant) one
differs from that of the first, calculation error in the function should be
trapped and therefore registered by means of MsgBox. In the moment, however,
when a user tries to select the second of range-inputs by dragging, even
pointing at the first cell of this range is immediately accepted and, due to
trapped error messages, the input obstinately fails. With difficulties two
cells can be selected at once but nothing more. The user must shift the
"dragging" selection to upper input line or type down the whole range address
in the input box manually. How would a professional (especially the most
valuable one) build the macro so that the UDF would be more user friendly?
For elucidation of the problem:
Function RangesDifferent(A, B) As Boolean
If A.Count <> B.Count Then
MsgBox "Dimensions of ranges differ"
RangesDifferent = True
End If
End Function
With all regards and thanks