View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Result in 3rd function from existing two functions

I do not think Excel will allow you to name a function C (or R for that
matter). Assuming your names will be more complex and that you tried to
simplify your problem for us (usually doing that is a bad idea), I'll assume
a function name of CC and, since you didn't tell us anything about the
functions, I used stand-in text surrounded by double angle brackets for the
function's arguments and data type....

Function CC(<<func A arg, <<func B arg) As <<data type
CC = WorksheetFunction.Min(A(<<func A arg) , B(<<func B arg))
End Function

If the arguments are the same for each function, then the above could be
simplified to this...

Function CC(<<arg) As <<data type
CC = WorksheetFunction.Min(A(<<arg), B(<<arg))
End Function

--
Rick (MVP - Excel)


"shabutt" wrote in message
...
I have two functions A & B in a single module which use "Select Case"
statement and want a third function C in the same module such that

Function C = If(B<=A,B,A)

Please code the function C for me. I am using Excel 2007.

TIA
A novice