title: Fully reference a worksheet by codename
body: <p>When I reference Excel worksheets using the CodeName property, how do I fully qualify them including the workbook reference?</p>
  
  <p>I want to guard against a scenario with two different workbooks open and two sheets having the same CodeName. I use <code>ThisWorkbook</code> because I want to reference the workbook the code is running from.</p>
  
  <p>I imagine something like this:</p>
  
  <pre><code>Dim tgWs As Worksheet
  Set tgWs = ThisWorkbook.WsSummary
  tgWs.Cells(1,1).Value = "Test"
  </code></pre>
  
  <p>where <code>WsSummary</code> is the sheet's codename.</p>