Below is the code I have for removing shapes and then copy/paste an image from one sheet to another in a specific cell. I am inconsistently getting the error 1004 paste method of worksheet class failed error. Any recommendations are greatly appreciated!
Code:
Public Sub fillPicture(inputValue)
Dim shownPicture
Dim listedPicture
For Each shownPicture In Worksheets(3).Shapes
If shownPicture.Type = msoPicture Then
shownPicture.Delete
End If
Next shownPicture
For Each listedPicture In Worksheets(8).Shapes
If LCase(Trim(listedPicture.Name)) = LCase(Trim(inputValue)) And listedPicture.Type = msoPicture Then
listedPicture.Copy
Worksheets(3).Paste Worksheets(3).Cells(27, 1)
End If
Next listedPicture
End Sub