I used this code (below) to insert a picture for an active sheet. I have a folder with 17 workbooks where each workbook is identical.
Is it possible to modify this code to insert a picture in only 3 sheets named "P1", "P2" and "P3" (which are protected) of each workbook in this folder?
Thanks.
Code: Select all
Sub InsertPicture()
Dim AddresPath As String
AddresPath = "C:\Users\mike\Pictures\cat.jpg"
Set myPicture = ActiveSheet.Pictures.Insert(AddresPath)
'Set the location, width and height
With myPicture
.ShapeRange.LockAspectRatio = msoTrue
.Height = 60
.Top = Rows(1).Top
.Left = Columns(1).Left
End With
End Sub