Quote:
|
I am taking a user-defined range and then passing it to a function which will apply a calculation to all the values in that range (say n ^ 2)
|
Possibly use Evaluate ?
Code:
Selection.Value = Evaluate("IF(ROW(" & Selection.Address & ")*ISNUMBER(" & Selection.Address & ")," & Selection.Address & "^2,TEXT(" & Selection.Address & ",""?""))")
above is based on contiguous range which may include both numerics & non-numerics, for non-contiguous range you would need to iterate the range areas