is this possible?
For example I have Function:
if
contains any error the whole function will return #value.
or if I have
before the rest of the code, it returns
in the cell.
As long as
dooesnt contain any errors, the UDF works and calculates intended results.
Without employing a subroutine first to replacre the erros in r1, or detecting, removing or replccing errors myself before the udf is used, i there (what is the way) to replace any and all errors in r1 with a 0, string or even "", before passing that new r1 to the rest of the function, - and if possible (though would be ok with that too if it works) without using for loops and/or the use of lbound ubound and without changing the source range in the sheet.
I.e. the range
would be the same, but what is eventually passed to r1 has any errors in/from r1 source, dealt with (replaced with strings or zeros).
Is this possible. I was thinking the range.replace method might help , but im not sure & wouldnt know how to use employ that. (or i might I refer to some old udfs have, which I will look into, but appreciate any help assistance offered)
For example I have Function:
Code:
My_Func(r1 As Range, DimensionA As Long) As Variant
if
Code:
r1
or if I have
Code:
Function My_Func(r1 As Range, DimensionA As Long) As Variant
On Error Resume Next
before the rest of the code, it returns
Code:
1
As long as
Code:
r1
Without employing a subroutine first to replacre the erros in r1, or detecting, removing or replccing errors myself before the udf is used, i there (what is the way) to replace any and all errors in r1 with a 0, string or even "", before passing that new r1 to the rest of the function, - and if possible (though would be ok with that too if it works) without using for loops and/or the use of lbound ubound and without changing the source range in the sheet.
I.e. the range
Code:
r1
Is this possible. I was thinking the range.replace method might help , but im not sure & wouldnt know how to use employ that. (or i might I refer to some old udfs have, which I will look into, but appreciate any help assistance offered)
Last edited: