Pass function as argument to UDF
On Wed, 8 Feb 2006 18:58:55 -0800, "Zack Barresse"
wrote:
If you have the value in a cell, you can just refer to the cell. There is a
difference between what a VBA function can receive for text length and what
you can put in a cell. Do a search on Excel's cell length limitations for
more information.
As an example, I can use the Rept function in a cell and have it's cell
length 32,767 characters long. I then use your UDF to point to that cell
"=MyUDF(A1)" and I get the same value, non-errored.
HTH
Yes, I can do that,too. But that is not the issue.
I don't see how what I've found on Excel's cell length limitation:
---------------------
Length of cell contents (text) 32,767 characters. Only 1,024 display in a cell;
all 32,767 display in the formula bar.
----------------------
Nor the length of a VBA string, whether it is in a variant or a string
-------------------------
A variable-length string can contain up to approximately 2 billion (2^31)
characters
Variant
(with characters) 22 bytes + string length Same range as for variable-length
String
------------------------
really explain why I cannot, under the *specific circumstances* I described,
pass a 255 character string to MyUDF but not be able to pass a 256 character
string.
--ron
|