View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Yet another basic problem

Vepa,
First, to write your function, you need to separate the arguments:
Public function test (arg1 as range, arg2 as range)
....etc

Then you have to enter the function and arguments in cell C2.
=test(A1,C14)

same as you do for any other Excel WS formula.

NickHK

"Vepa" wrote in message
...
Hi,

I have a very basic question concerning the VBA code in excel. I would

like
to know how can I decide into which cell does the excel enter the answer

of
my function?

For example, if my function goes as follows,
function test(s+b)
test=s+b
end function

so how can i tell the program that the result of the function should be
shown automatically in cell e.g "C2"?

Regards,
Vepa