I am trying to count the number of rows where a specific string appears in column K in a worksheet using a loop. The strings used for the search reside in Scorecards B2:B8. The count should be placed in the next column, C in this case. I am trying to pass the string in "op_id" to countif. When I run it all counted values in column C are 0. Here is what I have so far:
Dim op_id As String For i = 2 To 8 op_id = Sheets("Scorecards").Cells(i, 2) Sheets("Scorecards").Cells(i, 3) = "=COUNTIF('Raw Data'!K:K, & op_id)" Next i Thanks in advance!