I agree with XOR LX -- we need to know a little bit more about the context for your question before we can give a good answer.
Even if that cell is an argument for a VBA function that wants an array as input?
This suggests that your context involves a UDF that wants an array as input. Back when I was first learning to code VBA UDFs, I found that Excel could not send an array to VBA. It seems that Excel can only send three types of things to VBA:
1) A double (but not an array of doubles), which, of course, VBA can readily convert to other numeric data types like Long or Single or Integer.
2) A string, which would not usually undergo any type conversions while being passed to VBA.
3) A range object.
If I were coding a UDF where I wanted to pass the array of values in A1:G1 to that UDF, I would code the UDF to receive a Range object
function myudf(rangeinput as range)
'I can either use rangeinput as is to access individual values
'or, if I want to read the input range into a VBA variant/array
Dim arrayinput as variant
arrayinput=rangeinput.value
'do stuff with the input
myudf=output
end function
called from the spreadsheet =myudf(A1:G1)
Does that help any?
Bookmarks