I have a formula in a range of cells on a worksheet that calculates numerical values. How to get numeric values ββin VBA from a range passed to a function?
Say the first 10 rows of column A in a sheet contain rand (), and I pass this as an argument to my function ...
public Function X(data as Range) as double
for c in data.Cells
c.Value 'This is always Empty
c.Value2 'This is always Empty
c.Formula 'This contains RAND()
next
end Function
I am calling a function from a cell ...
=X(a1:a10)
How to get the value of a cell, for example. 0.62933645?
Excel 2003, VB6
Simon source
share