title: Looping a loop with slight change - opening folders and files, and then do the same loop again but open files from next folder
body: <p>I am new to VBA and would appreciate some help. I don't think it's that difficult, it's just that my knowledge limits me!</p>
  
  <p>I have created this following sub to open files containing *100 in folder "beamresult\1", and it works great.
  However, my challenge is, I have 12 different folders that I wish to open files from.
  Plus, in those folders I'd like to open the different files *100, *200, ..., *900.</p>
  
  <p>So in a way I would like to loop this sub, from folder 1 to 12. And in all those folders open all the files and edit them.</p>
  
  <p>(In the full sub there is lots of code before 'loop' to edit my file, but the same editing should be done for all the documents.)</p>
  
  <p>Hope that someone has a smart idea how to fix this!</p>
  
  <pre><code>Sub OpenFiles()
  'opens all files in a folder
  Dim MyFolder As String
  Dim MyFile As String
  
  MyFolder = "C:\Beamresults\1"
  MyFile = Dir(MyFolder &amp; "\*100.xls")
  
  Do While MyFile &lt;&gt; ""
  
  Workbooks.Open Filename:=MyFolder &amp; "\" &amp; MyFile
  
  MyFile = Dir
  
  Loop
  
  
  End Sub
  </code></pre>