View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RADO[_3_] RADO[_3_] is offline
external usenet poster
 
Posts: 79
Default How to create User Defined function in Excel

you should go to visual basic editor, add a module to your spreadsheet, and
then write the function:

Public Function calSales (FromDate as date, ToDate as date) as Double

calSales=....
end function

then use it in excel like a regular function, just type in a cell
=calSales(a2, b2)

Best -
RADO


"Johnny Ko" wrote in message
...
Hi

Is there any way to create UDF in Excel?

All I want is to have a function to retrieve the sales
amount from ODBC source. The following is an example.

From Date To date Amount
01/10/2003 31/01/2003 calSales(A2,B2)


calSales is an User Defined Function. It will return the
total sales amount between dates that entered at cell A2
and B2.

Thanks
Johnny Ko