title: Rename the only worksheet in multiple workbooks in a chosen directory
body: <p>I am at my wits end and have come to you for your help.</p>
  
  <p>What I am trying to accomplish is to rename a single worksheet (the only worksheet), in multiple workbooks, in a chosen directory to the workbook file name in Excel.</p>
  
  <p>I have found code that will work within a single workbook, however I do not know how to get it to work on multiple workbooks in a directory chosen by the user or ran from a batch/vbs file in the same directory.</p>
  
  <p>Here is the code I was using on a single workbook:</p>
  
  <pre><code>Sub RenameSheet()
  Dim wbname
  wbname = Replace(ActiveWorkbook.Name, ".xlsx", "")
      ActiveSheet.Select
      ActiveSheet.Name = wbname
      Range("A1").Select
  End Sub
  </code></pre>
  
  <p>I want to be able to do this for all files in a folder chosen by the user or files in the same directory as a batch file/vbs executable file if there is a way to execute this from running either a batch or vbs file?</p>
  
  <p>If there are questions or I have missing something, please let me know and I will answer to the best of my ability.</p>
  
  <p>Any help will be greatly appreciated.</p>