+ Reply to Thread
Results 1 to 5 of 5

Deleting objects within a certain range

  1. #1
    Registered User
    Join Date
    12-20-2005
    Posts
    44

    Deleting objects within a certain range

    Hi all,

    What is the best way to delete drawing objects within a certain range.

    Say I have several pictures contained with range E3:J7 and I want to use a macro to delete them at will. Can this be done.

    I tried recording a macro that goes to Edit|Go To|Special|Objects, but I couldn't revise it to be limited to a certain range. There are other objects in the sheet that I do not want to delete.

    Thanks for any advice.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello JohnnyBGood,

    Here is macro to delete pictures by range. Pictures within the given range will be deleted.

    Example: DeletePics Range("E3:J7")
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    12-20-2005
    Posts
    44
    Thanks for that Leith. Much appreciated.

    Is it possible to revise the code so the the range is fixed (i.e. Range("E3:J7") always). I want to put this within a larger code and I will always be deleting pics in that fixed range (not based on user selection).

    Thanks again.

  4. #4
    Registered User
    Join Date
    12-20-2005
    Posts
    44
    Anybody got any hints how I can use a fixed range in the code to delete the pictures within that range? I'm having difficulty altering the code given by Leith Ross to do that.

    Thanks.

  5. #5
    Registered User
    Join Date
    12-20-2005
    Posts
    44
    Okay, nevermind.....

    I found some code here: http://www.mvps.org/dmcritchie/excel/shapes.htm that suits my needs.

    Here's the code by Dave Peterson.

    Please Login or Register  to view this content.

+ 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