title: Check if sheet exists
body: <p>I want to check if the sheet named "test" exists and if not, create and name that sheet to "test".</p>
  
  <p>If it exists, I run a separate block of code which I haven't put up here. I have used error handling in that it ignores the error if it happens.  </p>
  
  <pre><code>If Sheets("test").Name = "" Then  
  'MsgBox Sheets("test").Name &amp; "Name"  
  .Worksheets.Add         After:=ThisWorkbook.Worksheets("test2")  
  .ActiveSheet.Name = "test"  
  End If  
  </code></pre>
  
  <p>No matter what I do, this section of the code always runs and creates a new sheet.</p>
  
  <p>The code runs properly if the sheet "test" doesn't exist already. It creates a new sheet and renames it and moves on. Obviously it doesn't rename the sheet in the other case since there's already another sheet "test" with the same name.</p>