title: Loop and count excel cells containing data, then loop over an action that many times
body: <p>I'm a novice vba coder and desperately need some assistance. </p>
  
  <p>Using the code below from another post I have modified it as a starter (likely the wrong way to do this), I need to </p>
  
  <ul>
  <li>loop over the entire Column A in worksheet <em>Test</em>.  </li>
  <li>Count the number of cells in that range that contain data.  </li>
  <li>With that count number I need to copy a file into a directory that many times appending the next number in the loop to the file name. </li>
  </ul>
  
  <p>So for instance if I found 210 cells containing data I want to take this file <code>C:\image\test.tif</code> and copy it 210 times to <code>C:\temp\imagecopy\test (1).tif</code>, then <code>C:\temp\imagecopy\test (2).tif</code>" and <code>C:\temp\imagecopy\test (3).tif</code> and so on. </p>
  
  <p>But I truly have no idea how to achieve this.  Here is what I have so far.</p>
  
  <pre><code>Sub CountTextPatterns()
  Dim rngToCheck As Range
  Dim cl As Range
  
  Set rngToCheck = Range("A1:A10000") //Set up the range that contains the text data
  
  Dim nothingHere As Integer
  Set nothingHere = ""
  
  
  //Loop through range, match cell contents to pattern, and increment count accordingly
  For Each cl In rngToCheck
      If nothingHere.Test(cl) Then
          nothingHere = nothingHere+ 1
      End If
  Next
  
  //For anything that isn't a letter or number, simply subtract from the and total row count
  cntNumber = rngToCheck.Rows.Count - cntnothingHere
  
  End Sub
  
  //So at this point I believe I should have the total cells that are not blank.  Now I need to execute a file copy action that many times using the logic mentioned at the top. 
  </code></pre>
  
  <p>Any assistance anyone can provide will be greatly appreciated!</p>