title: Excel VBA renames the wrong sheet
body: <p>I have an excel macro-enabled workbook that has 5 sheets. One of these sheets is named "NC" and one is named "SC". I have part of the code which adds dates to these sheets' names.</p>
  
  <p>Sheets("NC").Name = "NC" &amp; Replace(Date, "/", "-")
  Sheets("SC").Name = "SC" &amp; Replace(Date, "/", "-")</p>
  
  <p>Then later on if the reset button is clicked, I made a code to switch them back to previous "NC" and "SC" names but this is where I get the problem.</p>
  
  <p>Sheets(2).Name = "NC"
  Sheets(3).Name = "SC"</p>
  
  <p>Sheets(2).Name = "NC" works fine
  Sheets(3).Name = "SC" however, renames Sheet(4) instead</p>
  
  <p>I thought these sheet codes or sheet numbers don't change no matter how you rearrange or reorder your sheet tabs. I don't understand why it accurately renamed Sheets(2) but not Sheets(3). Look at my project explorer below, it renames Sheets(4) instead from "NCToday" to "SC". Sheets(3) is showing "SC" in the picture but because this was manually reset but you can see the arrangement, the code Sheets(3).Name = "SC" SHOULD NOT have renamed Sheets(4) from "NCToday" to "SC".</p>
  
  <p><img src="https://i.stack.imgur.com/SlnFI.jpg" alt="Sheet List"></p>