excel vba - Delete picture from a cell using vba -


i want copy new picture in cell using macros before copying new picture how can checked particular cell having picture or not, matching shape.topleftcell current cell not working me, appreciated!

' not working every picture sub deletecell(curcell) 'curcell=activewindow.activecell  dim sh shapes  each sh in activesheet.shapes     if sh.topleftcell.address = curcell.cells.address          sh.delete     end if next  end sub 

thanks

  1. change sub deletecell(curcell) sub deletecell(curcell range)
  2. change dim sh shapes dim sh shape
  3. change curcell.cells.address curcell.address

so code looks this

sub deletecell(curcell range)  'curcell=activewindow.activecell     dim sh shape      each sh in activesheet.shapes         if sh.topleftcell.address = curcell.address sh.delete     next end sub 

Comments