View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Function arguments without quotation marks

I don't think it is possible as when you do abc without quotes it could be a
range name or maybe something else. What you can do though is put abc in a
different cell and refer to that cell.

RBS

"marco" wrote in message
ups.com...
Hi group, again. One tricky question (I think). Is it at all
possible to pass arguments to a function without using quotation
marks? One example:

Function t(nome)
t = nome
End Function

On cell A1:

=t(abc)

Doing this I get on the cell the "#NAME?" error, and doing:

t = CStr(nome)

I get on the cell "Error 2029". However, doing:

=t(123)

No error happens. I don't know exactly why numbers can be passed
without quotation marks (but I think that it's because all non-numbers
are characters and characters are strings, maybe?)

Nevertheless, I would like to be able to use custom functions without
doing =t("abc"), but instead =t(abc)

Is it at all possible?

Sincere regards,
Marco