title: MS Excel VBA - Get file names within subfolders of a declared folder
body: <p>I am trying to loop through all subfolders within a folder, compiling all the names of the files. I'm having a bit of trouble though as I have adapted this code from a macro that only loops through one folder and compiles file names. Thank you greatly for your time!</p>
  
  <pre><code>Sub FindFiles()
  
  Cells(1, 1).Select
  
  Dim F As String
  Dim G As String
  
  F = Dir("C:\Users\z003nttv\Desktop\Folder\" &amp; "*")
  Do While Len(F) &gt; 0
  
  Do While Len(G) &gt; 0
  G = Dir(F &amp; "*.*")
  ActiveCell.Formula = G
  ActiveCell.Offset(1, 0).Select
  G = Dir()
  Loop
  F = Dir()
  Loop
  </code></pre>
  
  <p>End Sub</p>