+ Reply to Thread
Results 1 to 5 of 5

Delete pictures in spreadsheet

  1. #1
    seedman
    Guest

    Delete pictures in spreadsheet

    How can I get rid of a company logo that I imported into my spreadsheet
    several years ago and has grown to over 45000 duplications (layered). It has
    grown from repeated copy and paste functions while using the spreadsheet. I'm
    using Excel 97 and can't find a delete tab. Thanks.

  2. #2
    Tom Hutchins
    Guest

    RE: Delete pictures in spreadsheet

    This macro will delete all shapes in the active workbook:

    Sub DelAllShapes()
    Dim Shp As Shape, WS As Worksheet
    On Error Resume Next
    'Check every worksheet in the workbook
    For Each WS In ActiveWorkbook.Worksheets
    WS.Activate
    'Delete any other shapes on the sheet.
    For Each Shp In ActiveSheet.Shapes
    Shp.Delete
    Next Shp
    Next WS
    End Sub

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Hope this helps,

    Hutch

    "seedman" wrote:

    > How can I get rid of a company logo that I imported into my spreadsheet
    > several years ago and has grown to over 45000 duplications (layered). It has
    > grown from repeated copy and paste functions while using the spreadsheet. I'm
    > using Excel 97 and can't find a delete tab. Thanks.


  3. #3
    seedman
    Guest

    RE: Delete pictures in spreadsheet

    Thanks, Hutch. The macro worked great!
    Seedman

    "Tom Hutchins" wrote:

    > This macro will delete all shapes in the active workbook:
    >
    > Sub DelAllShapes()
    > Dim Shp As Shape, WS As Worksheet
    > On Error Resume Next
    > 'Check every worksheet in the workbook
    > For Each WS In ActiveWorkbook.Worksheets
    > WS.Activate
    > 'Delete any other shapes on the sheet.
    > For Each Shp In ActiveSheet.Shapes
    > Shp.Delete
    > Next Shp
    > Next WS
    > End Sub
    >
    > If you're new to macros, you may want to read David McRitchie's intro at:
    > http://www.mvps.org/dmcritchie/excel/getstarted.htm
    >
    > Hope this helps,
    >
    > Hutch
    >
    > "seedman" wrote:
    >
    > > How can I get rid of a company logo that I imported into my spreadsheet
    > > several years ago and has grown to over 45000 duplications (layered). It has
    > > grown from repeated copy and paste functions while using the spreadsheet. I'm
    > > using Excel 97 and can't find a delete tab. Thanks.


  4. #4
    Ron de Bruin
    Guest

    Re: Delete pictures in spreadsheet

    Warning

    Not use code like this

    >> For Each Shp In ActiveSheet.Shapes
    >> Shp.Delete
    >> Next Shp


    See why on this page
    http://www.rondebruin.nl/controlsobjectsworksheet.htm



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "seedman" <[email protected]> wrote in message news:[email protected]...
    > Thanks, Hutch. The macro worked great!
    > Seedman
    >
    > "Tom Hutchins" wrote:
    >
    >> This macro will delete all shapes in the active workbook:
    >>
    >> Sub DelAllShapes()
    >> Dim Shp As Shape, WS As Worksheet
    >> On Error Resume Next
    >> 'Check every worksheet in the workbook
    >> For Each WS In ActiveWorkbook.Worksheets
    >> WS.Activate
    >> 'Delete any other shapes on the sheet.
    >> For Each Shp In ActiveSheet.Shapes
    >> Shp.Delete
    >> Next Shp
    >> Next WS
    >> End Sub
    >>
    >> If you're new to macros, you may want to read David McRitchie's intro at:
    >> http://www.mvps.org/dmcritchie/excel/getstarted.htm
    >>
    >> Hope this helps,
    >>
    >> Hutch
    >>
    >> "seedman" wrote:
    >>
    >> > How can I get rid of a company logo that I imported into my spreadsheet
    >> > several years ago and has grown to over 45000 duplications (layered). It has
    >> > grown from repeated copy and paste functions while using the spreadsheet. I'm
    >> > using Excel 97 and can't find a delete tab. Thanks.




  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    here's a simple code

    Sub deletepic()
    Worksheets("sheet1").Pictures.Delete
    End Sub

+ 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