title: VBA Function Avoiding If Statements
body: <p>I'm building a pretty complicated VBA workbook, and one of the issues on running much of the code is performance.  I have a built in function that does, more or less, the following</p>
  
  <pre><code>Public Function zzz (xxx as String) as String
  if xxx = "apple" then zzz = "orange"
  if xxx = "appple2" then zzz = "orange2"
  if xxx = "apple3" then zzz = "apple3"
  </code></pre>
  
  <p>etc. (but with about 30 strings instead). I call this function multiple times.  Is there a better way to do this?</p>