+ Reply to Thread
Results 1 to 4 of 4

How to delete specific objects from a sheet?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    781

    How to delete specific objects from a sheet?

    Hi all,

    Trust you all doing well.

    Need a help with regards to the attached sheet.

    The file contains a macro "Clear" which deletes specific cells in the worksheet.

    In addition to this , i want the same macro to delete all the objects appearing only under column A (highlighted in Red) and not the two objects in Row 1 (highlighted in Green).

    When i go to special and select objects, it selects all. Can someone please help?

    Thanks in advance.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,077

    Re: How to delete specific objects from a sheet?

    Does this work for you?

    Sub Test()
    Dim shp As Shape
    For Each shp In Sheet1.Shapes
        If shp.TopLeftCell.Row >= 4 And shp.TopLeftCell.Column = 1 Then
            shp.Delete
        End If
    Next
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    781

    Re: How to delete specific objects from a sheet?

    @ByteMarks

    Works perfectly.

    Thanks a ton.

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,077

    Re: How to delete specific objects from a sheet?

    You're very welcome. Thanks for the feedback.

+ 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. Edit specific objects in protected work sheet
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2020, 04:23 AM
  2. VBA code to delete Drawing Objects from a specific Column.
    By hans302 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2016, 08:37 AM
  3. How do you delete Microsoft Excel Sheet Objects???
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 11:20 AM
  4. [SOLVED] Delete specific columns and sheet
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-20-2013, 12:57 PM
  5. Delete duplicates on a specific sheet
    By slim1313 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2009, 12:49 PM
  6. [SOLVED] How to delete specific row from sheet?
    By Sirritys in forum Excel General
    Replies: 5
    Last Post: 07-11-2006, 01:35 PM
  7. [SOLVED] delete hyperlinks from graphical objects in excel sheet
    By v_gyku in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-27-2005, 01:05 AM

Tags for this Thread

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