I took the freedom to mess around quite a bit with your code and made some modifications to make it run faster.
I think this does what you want.
Option Explicit
Sub InsertPicture()
Dim i As Integer, r As Integer, MergeCellsX As Integer, MergeCellsY As Integer
Dim myRow As Integer, picnum As Integer
Dim TotalRowsBetweenPics As Integer
Dim ImgFldr As String, MerCellName As String
Dim CurrentFile As String
Dim ImgLocX As Long, ImgLocY As Long
Dim ImgWidth As Single, ImgHeight As Single
Dim c As Range
Dim FirstLoop As Boolean
'http://www.excelforum.com/excel-programming-vba-macros/890783-insert-pictures-problem-with-macro.html
picnum = InputBox("Number of pictures")
ImgFldr = InputBox("Paste here the folder location") 'ex: C:\Images\Nature
MergeCellsX = 11
MergeCellsY = 2
TotalRowsBetweenPics = 33
ImgWidth = 528
ImgHeight = 382.5
i = 1
FirstLoop = True
For myRow = 1 To picnum * TotalRowsBetweenPics Step TotalRowsBetweenPics
MerCellName = "MerCell" & i
ActiveSheet.Cells(myRow, 1).Resize(MergeCellsY, MergeCellsX).Name = MerCellName
With ActiveSheet.Range(MerCellName)
.Merge
.Interior.Color = RGB(146, 208, 80)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Bold = True
.Borders.Weight = xlThin
.Value = "PICTURE REFERENCE " & i
End With
If FirstLoop = True Then
CurrentFile = Dir(ImgFldr & "\")
FirstLoop = False
Else
CurrentFile = Dir()
End If
ImgLocX = ActiveSheet.Range(MerCellName).Offset(1, 0).Left
ImgLocY = ActiveSheet.Range(MerCellName).Offset(1, 0).Top
ActiveSheet.Shapes.AddPicture ImgFldr & "\" & CurrentFile, True, True, ImgLocX, ImgLocY, ImgWidth, ImgHeight
i = i + 1
Next myRow
ActiveSheet.Shapes.SelectAll
Selection.ShapeRange.Line.Visible = msoTrue
Application.PrintCommunication = False
ActiveSheet.PageSetup.Zoom = 88
Application.PrintCommunication = True
End Sub
Bookmarks