I am trying to simplify some code and make it a bit more dynamic.
Currently the code looks like this (simplified to aid in this question)...
If x = "_One" Then
Module_One.Main()
Elseif x = "_Two"
Module_Two.Main()
Elseif x = "_Three"
Module_Three.Main()
...
Elseif x = <"_n">
Module<_n>.Main()
End If
...where depending on x as string, a function called "Main" in a module called Module<x> is then called.
Ideally I would like the code to function like this (i'm riffing on this code as I don't actually know if its even possible)...
Dim ModuleName as Module = "Module" & x
ModuleName.Main()
The closest example I can think of would be like when one builds a cell address from cell values, using indirect, in excel but instead of a cell address its a function address in different modules in vb.