title: VBA Excel, rename sheets base on Cell Value
body: <p>i need to rename all my sheets dynamically based on a range of cell values.
  This is my VBA codes, it keeps giving me a 'Runtime Error '1004 whenever i run it. </p>
  
  <pre><code>Sub RenameSheets()
  Dim MyCell As Range, MyRange As Range
  Set MyRange = Sheets("Config").Range("A5")
  Set MyRange = Range(MyRange, MyRange.End(xlDown))
  Sheets("Sheet1").Activate
  For Each MyCell In MyRange
  ActiveSheet.Name = MyCell.Value 'Error here. it works fine if i rename MyCell.Value to "AnyRandomValue"
  Worksheets(ActiveSheet.Index + 1).Select
  Next MyCell
  End Sub
  </code></pre>
  
  <p>I cant get my head around it. Why is it giving an error at MyCell.Value? Please help! </p>