Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-02-2013, 10:09 PM
omahadivision omahadivision is offline Can a function or sub be called using a variable name? Windows 7 32bit Can a function or sub be called using a variable name? Office 2007
Novice
Can a function or sub be called using a variable name?
 
Join Date: Oct 2012
Posts: 28
omahadivision is on a distinguished road
Default Can a function or sub be called using a variable name?

Hello,



I have a variable that can be about twenty values. For each different value, I would want to call a different sub or function. I don't want to have to have a ton of If or case statements. Is it possible to do something like

dim VariableName as string

(other code figures out what VariableName is)

then the function

Call VariableName

?

I have tried brackets, putting .value after variable name, quotes, and other tactics. I always am told that the sub or function is not defined. The sub or function VariableName would always exist, but I couldn't call it that way.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a function or sub be called using a variable name? object variable or with block variable not set MJP143 Excel 1 02-11-2013 05:07 AM
Can a function or sub be called using a variable name? Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM
excel where is procedure being called from davids67 Excel Programming 1 11-18-2011 06:48 AM
Can a function or sub be called using a variable name? What is this symbol called as? Franky Word 3 11-12-2011 08:16 AM
What is this right-click sub-menu called? wornways Word 3 08-13-2010 09:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft