title: Loop using CountIf for text then moving to next column
body: <p>I have one worksheet (Daily) with data in columns and a header. The data is dynamic based on the number of days in a month and it has been conditionally formatted to icons (Incomplete = T, Complete = R). I'm trying to create a chart on another worksheet (WS2) to show the percent complete and incomplete for each item (header).</p>
  
  <p>I have a table on a 3rd worksheet (WS3) to count all non-empty cells in each column, countif "T", and countif "R". (eg. =COUNTIF(Daily!D5:D29,"R")). The chart on WS1 selects data from WS3 for each item. Sometimes I have to add or delete a column on the Daily page. I'm trying to write a sub to loop through each column on Daily using CountIF and CountA and show the results on WS2.</p>
  
  <pre><code>Sub LoopforCt()
  
  Dim ws As Worksheet
  Dim Daily As Worksheet
  Dim Test As Worksheet
  Dim AllData As Variant
  Dim pcv As Range
  
  Set Daily = Sheets("Daily")
  Set Test = Sheets("Test")
  Set AllData = Daily.Range("B5:B100")
  Set pcv = Test.Range("A22")
  
  With AllData
   pcv = "=COUNTIF(Daily!C5:C29,""R"")"
  End With
  
  End Sub
  </code></pre>
  
  <p>I've been able to get the countif to work for the first column, but I'm lost on how to put this in a loop. I want to continue to CountIf for the next column's results in Test.Range("B22"), etc.</p>
  
  <p>Thank you!</p>