UDF argument type constraint

  • Thread starter Thread starter Art
  • Start date Start date
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
 
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
 
Avri,

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

Art
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top