title: How to get macros to work when sheet name is changed
body: <p>How do I make it so my macro will work on a spreadsheet even if someone changes the name of the tab for Sheet1, Sheet2, etc.</p>
  
  <p>For example this snippet from my code:</p>
  
  <pre><code>Set MyWorkbook = Workbooks.Open(DataDialog.SelectedItems(Counter))
  Set MySheet = MyWorkbook.Worksheets("Sheet1")
  </code></pre>
  
  <p>Gets the Run-time error '9':</p>
  
  <blockquote>
    <p>Subscript out of range </p>
  </blockquote>
  
  <p>The issue is I need this macro to able to be used on multiple different workbooks with different named tabs and in a lot of cases tabs will be hidden and what appears to be Sheet1 is really Sheet3.
  Is there a way to have a macro work on the active sheet alone?</p>