View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hokievandal Hokievandal is offline
external usenet poster
 
Posts: 13
Default Call UDF by String Name

I've made a custom object with a 'Function' method and need each instance of
the object to call a different UDF. Is there a way if I assign the UDF name
to the object's function as a string to call the function.

For example;
Public Function CalcRainfall(iDate as date) as double
'code to calculate rainfall...
End Function

Public Sub TestCalcRainfall()
Dim sUDF as string

sUDF = "CalcRainfall"

CustomObject.Function = sUDF
' code to run UDF

End Sub

Thanks,
Ryan