[VBA]Option Explicit

Function MyCheck(TheFileName) As Boolean
If InStr(TheFileName, "-CR-") > 0 And InStr(TheFileName, "-N.") > 0 Then MyCheck = True
End Function

Sub ChangeFilename()
Dim strfile As String, fileext As String
Dim filepath As String, filenum As String, n As Long 'My variables

filepath = BrowseForFolder("R:\DFS\Strategy and Compliance\FINEST\Projects\Imaging Trial\Documents\Creditors\") & "\"
strfile = Dir(filepath)
Do While strfile <> ""

Debug.Print strfile
'Check that filename is Isnumeric
If Not MyCheck(strfile) Then

If Right$(strfile, 3) = "tif" Or Right$(strfile, 3) = "pdf" Then

filenum = Left(strfile, Len(strfile) - 4)
fileext = Right(strfile, 3)
'End of each file name with - Cr -N
'Name filepath & strfile As filepath & filenum & Format(n, "1") + 1 & "." & fileext
n = n + 1
Name filepath & strfile As filepath & filenum & Format(n, "000000") & "-CR-" & Format(Now(), "YYMMDD") & "-N" & "." & fileext
End If
End If

strfile = Dir
Loop
End Sub[/VBA]