Welcome. I enter the report names in column f starting from row 7 and save
Each report has a pdf file in the test folder. What I'm looking for is a code that searches inside the folder and compares the names in the f column in order to get an alert message about the names of the files entered in the column that are not inside the folder.
I found this code, but I really don't know how to modify it
Each report has a pdf file in the test folder. What I'm looking for is a code that searches inside the folder and compares the names in the f column in order to get an alert message about the names of the files entered in the column that are not inside the folder.
I found this code, but I really don't know how to modify it
VBA Code:
Sub ScanForm4()
Dim FSO As Object
Dim tTable As String, I As Long, mCnt As Long
Dim myPath As String, myF As String, myMsg As String
'
myPath = ThisWorkbook.Path & "\test"
'
With ActiveSheet
For I = 7 To .Cells(Rows.Count, "f").End(xlUp).Row
myF = Dir(myPath & .Cells(I, "f").Value & ".pdf")
If myF = "" Then
myMsg = myMsg & .Cells(I, "f") & vbCrLf
mCnt = mCnt + 1
End If
Next I
End With
If mCnt > 0 Then
myMsg = "The following files have not yet been scanned: " & vbCrLf & myMsg & vbCrLf _
& "Please scan them into the correct folder and recheck"
Else
myMsg = "Check completed, ok"
End If
MsgBox (myMsg)
End Sub