Please find the code:
Problem is the folder has a large no. of files
===================================================================================== Dim fso, objFolder, obFileList, folderpath,counter folderpath = "G:\Everyone\Model Office Testing Documents\HP QC\QTP\PSISAutomation\Logs" Set fso = CreateObject("Scripting.FileSystemObject") Set objFolder = fso.GetFolder(folderpath) Set objFileList = objFolder.Files For Each File In objFileList msgbox("5") If InStr(1,File.Name,"DE_For_Pol_Print_APPA_7A_Copy_") = 1 Then counter=counter+1 End If Next counter=counter+1 msgbox("new file will be saved as: " &"DE_For_Pol_Print_APPA_7A_Copy_"& Chr(64 + Counter))