+ Reply to Thread
Results 1 to 4 of 4

Delete All Picture Objects Using VBA

  1. #1
    Nathan Bell
    Guest

    Delete All Picture Objects Using VBA

    All,

    I am looking for some code that will allow me to go in and delete all
    "Picture" objects from within a worksheet without deleting the rest of the
    data. Is this possible?

    Regards,

    Nathan



  2. #2
    Don Guillett
    Guest

    Re: Delete All Picture Objects Using VBA

    various ways

    Sub ShapesCut()
    For Each S In ActiveSheet.Shapes
    S.Cut
    Next
    End Sub
    'or

    Sub shapescut1() 'Tom Ogilvy
    ActiveSheet.Shapes.SelectAll
    Selection.Delete
    End Sub

    Sub ShapesALLinWorkbookDelete() 'Deletes all in WORKBOOK
    Dim sh As Worksheet
    For Each sh In ActiveWorkbook.Worksheets
    sh.DrawingObjects.Delete
    Next sh
    end sub
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Nathan Bell" <[email protected]> wrote in message
    news:%[email protected]...
    > All,
    >
    > I am looking for some code that will allow me to go in and delete all
    > "Picture" objects from within a worksheet without deleting the rest of the
    > data. Is this possible?
    >
    > Regards,
    >
    > Nathan
    >
    >




  3. #3
    Bernie Deitrick
    Guest

    Re: Delete All Picture Objects Using VBA

    Nathan,

    ActiveSheet.DrawingObjects.Delete

    Or simply use Edit | Go To... Objects, press OK, then Delete.

    HTH,
    Bernie
    MS Excel MVP


    "Nathan Bell" <[email protected]> wrote in message
    news:%[email protected]...
    > All,
    >
    > I am looking for some code that will allow me to go in and delete all
    > "Picture" objects from within a worksheet without deleting the rest of the
    > data. Is this possible?
    >
    > Regards,
    >
    > Nathan
    >
    >




  4. #4
    Debra Dalgleish
    Guest

    Re: Delete All Picture Objects Using VBA

    If you want to delete only Pictures, but not other shapes, such as text
    boxes, you can use code similar to the following:

    '======================
    Sub DeletePictures()
    Dim shp As Shape
    For Each shp In ActiveSheet.ShapeRange
    If shp.Type = msoPicture Then
    shp.Delete
    End If
    Next shp
    End Sub
    '=====================

    Nathan Bell wrote:
    > All,
    >
    > I am looking for some code that will allow me to go in and delete all
    > "Picture" objects from within a worksheet without deleting the rest of the
    > data. Is this possible?
    >
    > Regards,
    >
    > Nathan
    >
    >



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


+ 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