title: Are nested functions possible in VBA?
body: <p>I'm trying to clean up code by stripping parameters from a function within a private scope, like this:</p>
  
  <pre><code>Function complicatedFunction(x as Double, param1 as Double, param2 as Double)
      ...
  End Function
  
  Function mainActionHappensHere(L as Double, U as Double ...)
      Function cleaner(x)
          cleaner = complicatedFunction(x, L, U)
      End Function
      ...
      cleaner(x)                       'Many calls to this function
      ...
  End Function
  </code></pre>
  
  <p>Is this possible? Compiler complains, "Expected End Function", since I'm beginning a function before ending the outer one. And Google is no help :( PS I can't define cleaner() outside of mainActionHappensHere(), since then the correct L and U won't get passed into it.</p>