Sub TEST()
Dim Path As String, r As Range, filename As String, count As Integer
r = Range("J2")
Path = r & "*.docx"
On Error Resume Next
filename = Dir(Path)
Do While filename <> ""
count = count + 1
filename = Dir()
Loop
Range("I2") = count
End Sub
I have empty cells in I2:I1000 and the paths in J2:J1000 and i want fill the I2:I1000 with the counts By far i can fill only one cell. How can i fill all at once?
Thanks