sub or function argument

J

Jerry

Hi All,

How can I access the argument in a function?

Example :

Let A1=12

function t(C)
**Codes????***
end function

B1=t(A1)

this function should have result of A1 not 12

thanks
 
J

Jacob Skaria

Try

=testfunction(A1)

Function TestFunction(C)
TestFunction = C
End Function

?T() is already a built-in function

If this post helps click Yes
 
J

Jerry

thanks Jacob, but this will have a result of 12, not A1 as mentioned earlier.
the result should be the argument itself not the passing value.
 
J

Jacob Skaria

Try the below

Function TestFunction(c As Range)
TestFunction = c.Address(False, False)
End Function

If this post helps click Yes
 

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

Top