title: Function to check whether a sheet exists, in If statement
body: <p>I have a function to check whether a sheet exists. I cannot get it to work in an if statement. </p>
  
  <p>I would rather not create a variable before the if statement which saves the results. Should I change the function to a sub?</p>
  
  <pre><code>sub tester()
      If ShExist("Equity") = True then call differentfunction
  end sub
  
  Function ShExist(name As String)
      Dim WorksheetExists
      WorksheetExists = Evaluate("ISREF('" &amp; (name) &amp; "'!A1)")
  End Function
  </code></pre>