Hi, and thanks for your help

you can see my code below. I don't receive any errors, but my excel file is blank..

Sub run_macro_on_all_files()

Dim strPath As String
Dim strFiles As String
Dim cella

strPath = "C:\prova\"
If Not Dir(strPath & "*.txt") = "" Then 'test for existence of txt files
strFiles = Dir(strPath & "*.txt")
Do Until strFiles = ""

Open strFiles For Input As #1

Do Until EOF(1)
Line Input #1, textline
text = text & textline
Loop
'Close file
Close #1
ReadBRTLuminance = InStr(text, "Read BRT Luminance")
ActiveCell.Offset(cella, 1).Value = Mid(text, ReadBRTLuminance + 31, 9)
cella = cella + 1


strFiles = Dir
Loop
End If

End Sub