View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default What is the syntax for function text parameters in VBA (Excel

Function CONTAINS(within as String, test as String)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Jocken" wrote in message ...
| So I tried that like so:
|
| Function CONTAINS(within, test)
|
| Dim within As String
| Dim test As String
|
| the compiler complains about a duplicate declaration.
| what I want to say is "Function CONTAINS(String within, String test)"; All I
| need is for VBA to set up a function that expects two String-type parameters
| and does calculations with them.
|
| I miss Java... *tear
|
| "Toppers" wrote:
|
| Text parameters are STRING variables
| e.g.
|
| DIM mytext as string
|
| HTH
|
| "Jocken" wrote:
|
| I'm trying to create a custom function in excel 2007 using visual basic. The
| parameter type seems to default to numeric and I cannot figure out the syntax
| to specify text parameters. The example custom function in help only uses
| text parameters. I've gotten my function to compile, but using it results in
| a #VALUE!.