title: VBA rename sheet based on cell value
body: <p>I want a VBA code that rename my sheetXXX, where XXX is the value in the cell B5 in “Sheet1” sheet. The macro should work for any value in B5.</p>
  
  <p>I tried the following code:</p>
  
  <pre><code>Sub tabname()
      Dim sheetXXX As Worksheet
      XXX.Name = Worksheets("Sheet1").Range("B5").Value
  End Sub
  </code></pre>