View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
keiji kounoike keiji kounoike is offline
external usenet poster
 
Posts: 199
Default Here's how to require user to pass a particular param type toa cell function (intercepting #VALUE).

Then, Why did you declare param S as range?
When you give a string value, it will return #VALUE! though it couldn't
return a warning message.

Function Plural(ByVal S as Range) as String
Plural = S & "s"
End Function

As reference said, If an object has a default property, VarType (object)
returns the type of the object's default property. and I think range's
default property is the range's value, so if range's value is a string,
it return 8 and if range's value is a number, it will return 5.

keiji

wrote:
Dave:

Er...did I garble my msg.?

I know a string and range both work.

I need to *prevent* a string param from being passed. It must be a
range.

Thanks much for answering, as usual.

***