Option Explicit
Sub CreateImageFileCopies()
Dim folderName As String
folderName = "c:\users\domta\desktop\test\" 'change the path to folder accordingly
If Right(folderName, 1) <> "\" Then
folderName = folderName & "\"
End If
Dim imageFilename As String
imageFilename = "BlankImage.jpg"
Dim fileExt As String
fileExt = Mid(imageFilename, InStrRev(imageFilename, "."))
Dim lastRow As Long
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
If lastRow < 2 Then
MsgBox "No data found!", vbExclamation
Exit Sub
End If
Dim fileNames As Variant
fileNames = Range("A2:A" & lastRow).Value
Dim i As Long
For i = LBound(fileNames) To UBound(fileNames)
If Len(fileNames(i, 1)) > 0 Then
If Len(Dir(folderName & fileNames(i, 1) & fileExt, vbNormal)) = 0 Then
FileCopy folderName & imageFilename, folderName & fileNames(i, 1) & fileExt
Else
FileCopy folderName & imageFilename, folderName & fileNames(i, 1) & "_" & Format(Now(), "yyyy-mm-dd_hh-mm-ss") & fileExt 'add date and time stamp to filename
End If
End If
Next i
MsgBox "Completed!", vbExclamation
End Sub