title: How to pass a table name to a function in Excel
body: <p>I have various settings tables in Excel, each with two column headings Parameter and Value.</p>
  
  <p>I want to pass a specific table's name to a function <code>getParameter</code> that looks up a specific parameter's name in that table, returns the associated parameter's value, and performs all error handling, e.g. with the following code segment:</p>
  
  <pre><code>Function getParameter(....  
  ...  
  Dim paramterValue as Variant  
  With Application  
      parameterValue = .Index([tableName[Value], .Match("parameterName",  [tableName[Parameter], 0))  
      If Not IsError(parameterValue) then  
          ...  
      Else  
          ...  
      End If  
  End With
  
  End Function
  </code></pre>
  
  <p>How do I define the appropriate function arguments and call the function?  </p>