Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling function using variable as its name

Status
Not open for further replies.

uprichard

Programmer
May 2, 2002
16
I need to be able to call a function depending on the contents of a variable i.e

sMyVar = "Func_To_Call"
call sMyVar

Where the above would call "Func_To_Call". In other languages I could use the eval statement. Can it be done in VB?

I would also like the function to be in a side file that could be included at run time once the user has decided which function to run. Is that possible?

 
Depending of the application hosting the VBA code take a look at Eval or Application.Run

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top