title: VBA Code to Rename 1000s of Folders
body: <p>I'm very new to VBA and I'm trying to develop a code that renames folders. I have a worksheet in Excel set up like this: </p>
  
  <pre><code>Column A:  Path of Folder
  Column B:  Old Name
  Column C:  New Name
  </code></pre>
  
  <p>This is a code that I found which works on a single folder. I'm not sure if its possible to make an extension of this code (such as a loop) or if I need to develop a whole new code. Any help would be much appreciated.</p>
  
  <pre><code>Sub rename_folder()
      Dim old_name, new_name As String
      For i = 2 To Sheets(1).Range("a1").End(xlDown).Row
          new_name = Left(Sheets(1).Cells(i, 1).Value, Len(Sheets(1).Cells(i, 1).Value) - Len(Sheets(1).Cells(i, 2).Value))
          new_name = new_name &amp; Sheets(1).Cells(i, 3).Value
          old_name = Sheets(1).Cells(i, 1).Value
          Name old_name As new_name
      Next i
  End Sub 
  </code></pre>