Inserting pictures into cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We are trying to insert pictures into cells that can be deleted when you
delete the row.
 
Insert a picture as normal

Right click and go into format picture

choose properties, and check move and size with cells

then when you move, resize or delete cell/row the pciture will b
delete
 
This will not delete the picture
Use F5 objects after you do the delete to see that it is still there
 
Maybe you could provide the user a macro that deletes the pictures that have
their topleftcell in the selected range's rows.

Option Explicit
Sub testme()
Dim myRng As Range
Dim myPict As Picture

Set myRng = Selection

For Each myPict In ActiveSheet.Pictures
If Intersect(myPict.TopLeftCell, myRng.EntireRow) Is Nothing Then
'do nothing
Else
myPict.Delete
End If
Next myPict

myRng.EntireRow.Delete

End Sub

The pictures have .bottomrightcell, too. So you could check that instead (or
even check both corners).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top