UDF argument type constraint

A

Art

Hi all,

I have been forwarded the following UDF function as it is entered in a
cell

=woff(df3)

The argument "df3" is a text string used in a select case statement in
the UDF , not an address reference.

The user does not want to place quotes around the argument every time
he works on it.

Does anyone know how I can modify the UDF to allow for this

This is the header line of the UDF:

Public Function woff(cpMeasure) As Double

Regards

ArtWork
 
A

Arvi Laanemets

Hi

Are you sure you really want this? At moment, the user can use any string
expression as argument - then this is no option anymore. P.e. now you can
enter into some cell (let's it be X1) your value (X1="df3"), and then refer
to this cell in your UDF <=WOFF(X1)>. With change you want this won't work
anymore, because any entry is treated as string.


Arvi Laanemets
 
A

Art

Avri,

Yes I am aware of this but the user feels strongly that he wants the
argument entered directly in the cell

Art
 
B

Bob Phillips

Can't do it, unless the string is a valid cell address. So DF3 could be made
to work, JA2 couldn't. The only proper way to pass a string value is as a
string, or as a range value.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
Top