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
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"
etc. (but with about 30 strings instead). I call this function multiple times. Is there a better way to do this?
vlookup()for this.if elseat the least.