Q:

How do I, modify vba code to repeat until finished?

I found a piece of vba code that counts the number of xml files in a specific folder, i modified it to only count files with a specific string (located in cell F3) as part of the file name. And print that count in the adjacent cell (cell G3). Its working as expected.
My problem is that I need the results for a entire range. The range of strings are created from a pivot table.
I tried just dublicating the code and modifying the reference cells, and that works. But the range can be from a few strings to 70+, i'm sure that there is a much more efficient and cleaner way than running the code 70+ times.
Dim FolderPath As String, path As String, count As Integer

FolderPath = "C:\Test\PJC"
path = FolderPath & "\*" & Range("F3") & "*.xml"

FileName = Dir(path)

Do While FileName <> ""
   count = count + 1
    FileName = Dir()
Loop

Range("G3").Value = count

A:

Guess this will do the trick.
I took your code and put it in a For loop.
I define the start row as row 3.
EndRange will search for the last value in column F. The For loop will iterate from StartRange to EndRange values.
I also made the count to print the the result from the count variable for each loop in the G column.
Sub LoopRange()

Dim FolderPath As String, path As String, count As Integer
Dim StartRange As Long, EndRange As Long

StartRange = 3 'Row = 3 for start
EndRange = Cells(Rows.count, "F").End(xlUp).Row 'Find last row in column F

For i = StartRange To EndRange 'Loop from start to end value

    FolderPath = "C:\Test\PJC"
    path = FolderPath & "\*" & Range(Cells(i, "F"), Cells(i, "F")) & "*.xml" 'Take the value from row i and column F in the loop.

    Filename = Dir(path)

    Do While Filename <> ""
        count = count + 1
        Filename = Dir()
    Loop

    Range(Cells(i, "G"), Cells(i, "G")).Value = count 'Print the count

Next i

End Sub

