title: vba how to immitate OOP style
body: <p>I would like to have some hardcoded varaibles and I would like to separete this from my actual code. In PHP I would use a config class and call config->foo later on. Is that somehow similar possible in VBA?</p>
  
  <p>I thought on a config function and call it like Config("Foo"). </p>
  
  <p>Does this somehow work or must I go via Global Variables for the solution?</p>
  
  <pre><code>Sub SomeFunction()
  
  Dim I As Long
  
  I = Config("Foo") ' is supposed to be I = 1
  
  End Sub
  
  Public Function Config(VariableName As String) As Variant
  
  Static Foo As Long
  Static Bar As String
  Static SomeOtherVarThatIJustQuicklyMadeUp As String
  Foo = 1
  Bar = "Example"
  Dim ReturnValue As Variant
  ReturnValue = GetVariableByName(VariableName)
  Config = ReturnValue
  
  End Function
  </code></pre>