+ Reply to Thread
Results 1 to 3 of 3

Delete grouped shapes?

  1. #1
    Registered User
    Join Date
    11-02-2004
    Location
    Slovenia, LJ
    MS-Off Ver
    2007
    Posts
    40

    Delete grouped shapes?

    Hello

    I’m trying to delete grouped shapes objects with name “Group 8”. On the sheet are also other shape object (not grouped) which I won’t to delete. The code which I write won’t work. I thing that something is wrong the name, but I don’t know what. Can you help me.

    Sub Delete_shapes()
    Dim SHP As Shape
    For Each SHP In ActiveSheet.Shape
    If Not SHP.Name = "Group 8" Then
    SHP.Delete
    End If
    Next SHP
    End Sub

    Than you

    Drile

  2. #2
    Norman Jones
    Guest

    Re: Delete grouped shapes?

    Hi Dr. Ile,

    Your question appears ambiguous.

    However, try changing:

    > For Each SHP In ActiveSheet.Shape


    to

    For Each SHP In ActiveSheet.Shapes


    ---
    Regards,
    Norman



    "Dr.Ile" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello
    >
    > I'm trying to delete grouped shapes objects with name "Group 8". On the
    > sheet are also other shape object (not grouped) which I won't to delete.
    > The code which I write won't work. I thing that something is wrong the
    > name, but I don't know what. Can you help me.
    >
    > Sub Delete_shapes()
    > Dim SHP As Shape
    > For Each SHP In ActiveSheet.Shape
    > If Not SHP.Name = "Group 8" Then
    > SHP.Delete
    > End If
    > Next SHP
    > End Sub
    >
    > Than you
    >
    > Drile
    >
    >
    > --
    > Dr.Ile
    > ------------------------------------------------------------------------
    > Dr.Ile's Profile:
    > http://www.excelforum.com/member.php...o&userid=15975
    > View this thread: http://www.excelforum.com/showthread...hreadid=527961
    >




  3. #3
    NickHK
    Guest

    Re: Delete grouped shapes?

    Dr.Ile,
    From your code it looks like you are trying to delete all shapes except
    "Group 8".
    Anyway, For Each.. requires a collection, so it is "ShapeS", not "Shape".
    You would found an error on this line when you tried to run it.

    NickHK

    "Dr.Ile" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello
    >
    > I’m trying to delete grouped shapes objects with name “Group 8”. On the
    > sheet are also other shape object (not grouped) which I won’t to delete.
    > The code which I write won’t work. I thing that something is wrong the
    > name, but I don’t know what. Can you help me.
    >
    > Sub Delete_shapes()
    > Dim SHP As Shape
    > For Each SHP In ActiveSheet.Shape
    > If Not SHP.Name = "Group 8" Then
    > SHP.Delete
    > End If
    > Next SHP
    > End Sub
    >
    > Than you
    >
    > Drile
    >
    >
    > --
    > Dr.Ile
    > ------------------------------------------------------------------------
    > Dr.Ile's Profile:

    http://www.excelforum.com/member.php...o&userid=15975
    > View this thread: http://www.excelforum.com/showthread...hreadid=527961
    >




+ 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