LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default delete a shape

probably a quick and easy question but I cannot seem to figure it out. here
goes

I have a button that inserts a copy of a shape into the active cell when
clicked. what I want to do is delete the existing shape if one exists (in
that activecell) and paste in the new one. here is my code. thanks for any
help. much appreciated.

Private Sub CommandButton2_Click()
'check for existing shape in activecell - If one exists then delete, if not
continue
ActiveSheet.Shapes("Picture 1").Select
Selection.Copy
ActiveCell.Select
ActiveSheet.Paste
Selection.ShapeRange.IncrementTop 10
Selection.ShapeRange.IncrementLeft -2
ActiveCell.Value = 1
ActiveCell.Next.Select
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for a shape - then change or delete it if it exists Mona-ABE Excel Programming 2 May 30th 07 05:37 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Why can't I delete this shape now? JK Excel Programming 4 July 22nd 05 05:24 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"