Hi,
I have a sheet with mutiple (same) pictures on it, so when this sheet is printed, the picture (kind of logo) sits on top of every page.
Now I want to change those pictures with a new logo with a macro.
I tried this piece of code I found, but it's nit quite what I need.
Also , i have to run it a few times before all old pics are deleted.
The big problem I think is, the placement of the pics.
You can iagine that every 50 lines (or so) this pic is present and needs to be replaced at the same position.
Hope someone can help me.
This is the code what I tried:
Office 2010
I have a sheet with mutiple (same) pictures on it, so when this sheet is printed, the picture (kind of logo) sits on top of every page.
Now I want to change those pictures with a new logo with a macro.
I tried this piece of code I found, but it's nit quite what I need.
Also , i have to run it a few times before all old pics are deleted.
The big problem I think is, the placement of the pics.
You can iagine that every 50 lines (or so) this pic is present and needs to be replaced at the same position.
Hope someone can help me.
This is the code what I tried:
Code:
Sub NieuwLogo()
Dim vs As Worksheet
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
For i = 1 To ws.Shapes.Count
If ws.Shapes(i).Name = "Group 28" Then
ws.Shapes(i).Delete
ws.Pictures.Insert ("Z:\Thea\logo-oranje.png")
'With ws.Shapes(ws.Shapes.Count)
With ws.Shapes(ws.Shapes)
.Top = ws.Range("A1").Top
.Left = ws.Range("A1").Left
.LockAspectRatio = msoFalse
.Height = 150
.Width = 150
End With
Else
End If
Next i
Next ws
End Sub
Office 2010