+ Reply to Thread
Results 1 to 7 of 7

Delete all shapes in range

  1. #1
    Registered User
    Join Date
    03-21-2017
    Location
    Toowoomba, Australia
    MS-Off Ver
    365
    Posts
    10

    Delete all shapes in range

    Hi,

    I've google'd this question and found a few different codes all which returns errors for me and I don't know VBA code very well.

    I have made a few codes with some helpful guides I've found but this one is beating me. I have a code that draws an oval around the active cells, which I'm using as a quick way to see recent changes between users and was hoping to work out a code to delete all of the ovals created in a range with another button. (I'm working with computer novices and everything is easier when they can click a button).

    Any help even a link to a guide would be greatly appreciated, thanks in advance.

    Bahal

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Delete all shapes in range

    Just Oval?
    Select the range then run
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-21-2017
    Location
    Toowoomba, Australia
    MS-Off Ver
    365
    Posts
    10

    Re: Delete all shapes in range

    Thanks for the reply,

    I'm getting the same error on this line:

    Please Login or Register  to view this content.
    Also, it doesn't have to be just ovals if that helps and lastly could it be a defined range eg "A2:J25".

    Really appreciate the help.
    Last edited by jeffreybrown; 05-31-2017 at 09:59 PM. Reason: Please use code tags!

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Delete all shapes in range

    If not only oval then
    Please Login or Register  to view this content.
    And I can not replicate the error that you got.
    If you upload your workbook, it will help.

  5. #5
    Registered User
    Join Date
    03-21-2017
    Location
    Toowoomba, Australia
    MS-Off Ver
    365
    Posts
    10

    Re: Delete all shapes in range

    Here is an example file,

    The code works for me until there are more than one shape in the selection range.

    If I changed this:
    Set r = Selection
    To This:
    Set r = Sheets.("Test").Range("A2:C26")

    Would that delete the shapes in the selected area?
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Delete all shapes in range

    You have a period that should not be there.
    Set r = Sheets.("Test").Range("A2:C26")
    Changed slightly
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-21-2017
    Location
    Toowoomba, Australia
    MS-Off Ver
    365
    Posts
    10

    Re: Delete all shapes in range

    Thanks, trying to teach myself little bits here and there so I can write these better. Thank-you for all your help on my little problem

+ 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. [SOLVED] Marco to delete shapes
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 03:59 AM
  2. [SOLVED] If shapes exist then delete
    By wrightyrx7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2014, 07:21 AM
  3. [SOLVED] How to delete all Shapes in all WS within a WB
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-16-2013, 10:52 PM
  4. Delete all shapes in specified range with macro
    By digiac in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-16-2013, 08:01 AM
  5. Delete shapes in a range macro not working
    By snoopyngd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-04-2011, 06:02 AM
  6. Delete Shapes in Range
    By pr4t3ek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2009, 02:40 AM
  7. Delete shapes from active sheet cell range:Resolved
    By ge0rge in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2008, 08:01 PM

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