Sub kTest()
Dim strFolder As String
Dim strFileName As String
Dim wbkTemplate As Workbook
Dim wbkActive As Workbook
Dim k, i As Long, c As Long
With Application.FileDialog(4)
.AllowMultiSelect = False
.Show
If .SelectedItems.Count = 0 Then Exit Sub
strFolder = .SelectedItems(1)
End With
Const ColumnHeaderIsThere As Boolean = True '<<=== set false if no header
With Application
.ScreenUpdating = 0
.DisplayAlerts = 0
End With
Set wbkActive = ThisWorkbook
strFileName = Dir(strFolder & "\*.xls*")
Do While Len(strFileName)
Set wbkTemplate = Workbooks.Open(strFolder & "\" & strFileName)
With Application.Intersect(ActiveSheet.UsedRange, Columns("l:n"))
k = .Value2
For i = 1 + IIf(ColumnHeaderIsThere, 1, 0) To UBound(k, 1)
For c = 1 To UBound(k, 2)
If InStr(1, k(i, c), ".jpg",1) = 0 Then
If LCase$(Right$(k(i, c), 3)) = "jpg" Then
k(i, c) = Replace(LCase$(k(i, c)), "jpg", ".jpg")
Else
k(i, c) = k(i, c) & ".jpg"
End If
End If
Next
Next
.Value2 = k
End With
wbkTemplate.Close 1
Set wbkTemplate = Nothing
strFileName = Dir()
Loop
With Application
.ScreenUpdating = 1
.DisplayAlerts = 1
End With
End Sub