title: Excel VBA call function with variable name
body: <p>I'm trying to call a function with a variable name that is generated at run time based upon a combo box value.  This is straightforward in most languages but I can't seem to figure it out in Excel VBA, I suspect this is because I don't really understand how the compiler works.  I've found several posts that are close but don't quite seem to do the trick.  The code below is wrong but should give an idea of what I want.</p>
  
  <p>Thanks</p>
  
  <pre><code>Sub main()
      'run formatting macros for each institution on format button click
  
       Dim fn As String
       Dim x As Boolean
  
       'create format function name from CB value        
       fn = "format_" &amp; CBinst.Value
  
       'run function that returns bool
       x = Eval(fn)
  
       ...
  
  End Sub
  </code></pre>