+ Reply to Thread
Results 1 to 4 of 4

Delete a shape with a button push

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Delete a shape with a button push

    A little unusual but I am hoping there is a way.....

    I have a seried of buttons that I have placed on a worksheet through VBA. As part of the program operation a user can select a button and cause a shape (circle or square) to be placed on the sheet at that button's location.

    This part of the program works.

    However - I want to have the user also be able to remove that shape. So I have a button placed over each shape that has previously been placed. When the user selects a button I want the shape to be deleted that is located directly under the button. Struggling with being able to find / select / and then delete the shape with a specific button selection.

    Thoughts?

  2. #2
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Delete a shape with a button push

    you can try an code like this..

    Please Login or Register  to view this content.
    here Rectangle 1 is the shape.
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  3. #3
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Delete a shape with a button push

    Thanks -

    Question - Can the range also be a range of cells? I no the TopLeftCell of the button that is being pushed so I could specifiy a range of cells to select the shape below the button.

  4. #4
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Delete a shape with a button push

    i am not sure about giving the ranges.. but you can use the name which was defined for the shape to delete..

    ex: when you insert an circle you will get an name as circle 1.. you can select that and delete..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1