title: Delete one image in sheet with multiple images in Excel
body: <p><strong>Situation</strong></p>
  <p>I have got multiple images in one sheet. These images are in predetermined ranges. I have defined these ranges in a cell, as you can see in my code. The first image is in <code>Range(&quot;A1:V31&quot;)</code> and the next one in <code>Range(&quot;A32:V62&quot;)</code> and then two others. These images are updated from another workbook. Four ranges,
  four different images and thus four different workbooks. When an image is updated I want to delete it first to prevent the workbook from becoming too large.</p>
  <p><strong>Problem</strong></p>
  <p>Can't delete one image on the sheet when there are other pictures present on it. The code below works when there is only one image present in the sheet. It also doesn't matter in what range this one image is. But the code doesn't delete any images anymore once there are multiple images in multiple ranges. <a href="https://www.myonlinetraininghub.com/excel-forum/vba-macros/how-do-i-delete-images-in-a-specific-range" rel="nofollow noreferrer">Here is the link of my source for the code below</a></p>
  <pre><code>Sub DeleteImage2()
  
  Dim myRange3 As String
  Dim pic As Picture
  
  myRange3 = Sheets(&quot;input&quot;).Range(&quot;M25&quot;).Value
  
  Windows(&quot;OnderhoudsOverzicht&quot;).Activate
  ActiveSheet.Unprotect
  
  For Each pic In ActiveSheet.Pictures
     If Not Application.Intersect(Range(myRange3), pic.TopLeftCell) Is Nothing Then
        pic.Delete
     End If
  Next
  
  End Sub
  </code></pre>
  <p>Thanks for any help in advance!</p>