Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Call UDF by String Name

Thanks Bob...

"Bob Phillips" wrote:

Public Function CalcRainfall(iDate As Date) As Double
'code to calculate rainfall...
End Function

Public Sub TestCalcRainfall()
Dim sUDF As String

sUDF = "CalcRainfall"

Application.Run sUDF, Date

End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Hokievandal" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: Use pic location string to call up picuture in cell? vloh28 Excel Discussion (Misc queries) 1 October 30th 07 12:42 AM
How do I call a dynamically created String in a VBA Sub [email protected] Excel Programming 4 December 25th 06 02:36 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
sub call with string aran Excel Programming 5 June 18th 05 05:33 PM
Excel4 Call to get Function String Rob Bovey Excel Programming 6 September 24th 03 06:34 PM


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"