title: Collecting data from files in folders with VBA and excel
body: <p>I'm fairly new to VBA and macro's, so I'm writing a post here to hopefully get some help and tips for my solution. My problem is as follows:</p>
  
  <p>I need to copy an uncertain amount of cells containing data from excel-files in folders and subfolders to paste in an excel-"mother"-file:</p>
  
  <p><em>"All files that contain data is in one folder and it's subfolders. the cells to be copied in theese files ALWAYS start at row 40, and are in cells A, B, C and D. How many rows that need to be copied however is uncertain."</em></p>
  
  <p>What I'm looking for is code that loops through a folder and it's subfolders looking for files to get data from. I'm also thinking that inside this loop I will later write code to collect data from each individual file.</p>
  
  <p>SO, what I'm looking for is:
  - Code to loop through a folder and subfolders to collect data from file.
  - Code that finds last row with data and copies all data from start to this last row. I'm thinking something like: "A40:D &amp; UncertainRange"</p>
  
  <p>All help is greatly appreciated.. afterall I'm still a VBA Noob.
  Have a great weekend, and may all of your problems be solved by scripting.</p>
  
  <p>Good day.</p>