+ Reply to Thread
Results 1 to 13 of 13

Macro for ActiveSheet.Shapes.Delete

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Macro for ActiveSheet.Shapes.Delete

    Hi this piece of macro works:

    Please Login or Register  to view this content.


    this non work .ActiveSheet.Shapes.Delete ????????? to delete shape in the sheet

    and this:

    ActiveWindow.FreezePanes = False (deletr freesepanes)
    ActiveSheet.OLEObjects.Delete (delete commandbutton)


    a help?
    max
    Last edited by max_max; 06-07-2018 at 02:16 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: macro delete

    You need to loop through each shape to see if it is in that range.

    Just search for delete shapes in a range

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: macro delete

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro delete

    Hello max_max,

    Try;

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro delete

    hi
    we must eliminate shape "rounded rectangle 1-2-3-4-5-6-7-8-9-10-11-12"
    and not shape "image 1"
    it's possible?
    max

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: macro delete

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  7. #7
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro delete

    Attaching example.
    max
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this ‼


    Easy with shape type :

    PHP Code: 
    Sub DeleteAllShapes()
             
    Dim oSh As Shape
        
    For Each oSh In Foglio6.Shapes
              
    If oSh.Type msoAutoShape Then oSh.Delete
        Next
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro delete

    Hello max_max,

    Try;
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Winon; 06-08-2018 at 11:01 PM.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: macro delete

    Maybe this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro delete

    @ bakerman2,

    Hi Rudi,

    Jy is reg! I read the requirement wrong way round. So I have changed my Code to;

    Please Login or Register  to view this content.
    B.T.W. your Code errs on my system?

    Groete
    Last edited by Winon; 06-08-2018 at 10:59 PM.

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: macro delete

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro delete

    Thanks to everyone for the interventions but I have to try the most exact solution on Monday.
    Thank you all.
    max_max

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. #application caller shapes(activesheet.name) #
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-25-2016, 03:45 PM
  2. activesheet.shapes.addchart
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2015, 04:47 AM
  3. Error 1004: ActiveSheet.Shapes.AddChart.Select
    By andynewtovba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2015, 12:08 PM
  4. [SOLVED] ActiveSheet.Shapes.AddChart.Select Run-Time Error '1004'
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 11:30 AM
  5. [SOLVED] Condensing ActiveSheet.Shapes().Visible=True
    By eculver in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-15-2013, 07:52 PM
  6. VBA Code to list all activesheet shapes in excel
    By baisty182 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2011, 10:43 AM
  7. ActiveSheet.Shapes
    By ole_ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2005, 10:06 AM

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