+ Reply to Thread
Results 1 to 9 of 9

Macro to delete pictures ?

  1. #1
    Steve
    Guest

    Macro to delete pictures ?

    I recorded a macro to delete 3 pictures that are copied onto my spreadsheet
    every week. However, when I run the macro, I get a run time error stating
    "item with the specified name not found". Looking at the macro, it indicates
    shapes ( picture 1), shapes ( picture 2), etc.

    Is there a fix for this ?

    Thanks,

    Steve

  2. #2
    Don Guillett
    Guest

    Re: Macro to delete pictures ?

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

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Steve" <[email protected]> wrote in message
    news:[email protected]...
    > I recorded a macro to delete 3 pictures that are copied onto my

    spreadsheet
    > every week. However, when I run the macro, I get a run time error stating
    > "item with the specified name not found". Looking at the macro, it

    indicates
    > shapes ( picture 1), shapes ( picture 2), etc.
    >
    > Is there a fix for this ?
    >
    > Thanks,
    >
    > Steve




  3. #3
    Ron de Bruin
    Guest

    Re: Macro to delete pictures ?

    hi

    Mayve the name have a space in it ?
    See
    http://www.rondebruin.nl/controlsobjectsworksheet.htm



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


    "Steve" <[email protected]> wrote in message news:[email protected]...
    >I recorded a macro to delete 3 pictures that are copied onto my spreadsheet
    > every week. However, when I run the macro, I get a run time error stating
    > "item with the specified name not found". Looking at the macro, it indicates
    > shapes ( picture 1), shapes ( picture 2), etc.
    >
    > Is there a fix for this ?
    >
    > Thanks,
    >
    > Steve




  4. #4
    Steve
    Guest

    Re: Macro to delete pictures ?

    Thanks guys,

    I went to your link, and I undesrtood the F5-Special-Objects-OK-delete, so I
    tried that, and it worked great. However, I also had some macro buttons on
    the worksheet that also were deleted ( objects.select). Here's the macro:

    Sheets("test").Select
    ActiveSheet.DrawingObjects.Select
    Selection.Delete

    There probably is info on your link that will delete all objects but my
    macro buttons, but I can't figure it out.

    Thnaks again,

    Steve

    "Ron de Bruin" wrote:

    > hi
    >
    > Mayve the name have a space in it ?
    > See
    > http://www.rondebruin.nl/controlsobjectsworksheet.htm
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Steve" <[email protected]> wrote in message news:[email protected]...
    > >I recorded a macro to delete 3 pictures that are copied onto my spreadsheet
    > > every week. However, when I run the macro, I get a run time error stating
    > > "item with the specified name not found". Looking at the macro, it indicates
    > > shapes ( picture 1), shapes ( picture 2), etc.
    > >
    > > Is there a fix for this ?
    > >
    > > Thanks,
    > >
    > > Steve

    >
    >
    >


  5. #5
    Ron de Bruin
    Guest

    Re: Macro to delete pictures ?

    Hi Steve

    You can try

    Sub Shapes2()
    'Loop through the Shapes collection and use the Type number of the control
    Dim myshape As Shape
    For Each myshape In ActiveSheet.Shapes
    If myshape.Type = 13 Then myshape.Delete
    Next myshape
    End Sub


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


    "Steve" <[email protected]> wrote in message news:[email protected]...
    > Thanks guys,
    >
    > I went to your link, and I undesrtood the F5-Special-Objects-OK-delete, so I
    > tried that, and it worked great. However, I also had some macro buttons on
    > the worksheet that also were deleted ( objects.select). Here's the macro:
    >
    > Sheets("test").Select
    > ActiveSheet.DrawingObjects.Select
    > Selection.Delete
    >
    > There probably is info on your link that will delete all objects but my
    > macro buttons, but I can't figure it out.
    >
    > Thnaks again,
    >
    > Steve
    >
    > "Ron de Bruin" wrote:
    >
    >> hi
    >>
    >> Mayve the name have a space in it ?
    >> See
    >> http://www.rondebruin.nl/controlsobjectsworksheet.htm
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "Steve" <[email protected]> wrote in message news:[email protected]...
    >> >I recorded a macro to delete 3 pictures that are copied onto my spreadsheet
    >> > every week. However, when I run the macro, I get a run time error stating
    >> > "item with the specified name not found". Looking at the macro, it indicates
    >> > shapes ( picture 1), shapes ( picture 2), etc.
    >> >
    >> > Is there a fix for this ?
    >> >
    >> > Thanks,
    >> >
    >> > Steve

    >>
    >>
    >>




  6. #6
    Steve
    Guest

    Re: Macro to delete pictures ?

    I surely appreciate your help, but I feel shapelessly looped, because I don't
    understand most of the terminology. When I select-all copy the webpage to my
    file, in addition to the data I need, it has 3 pictures that it copies. The
    tab I'm pasting it to also has 2 of my buttons from the forms toolbar that
    I've assigned macros to. I'd like to be able to delete those 3 pictures, but
    leave my 2 buttons.

    Sorry that I'm so confused.

    Steve

    "Ron de Bruin" wrote:

    > Hi Steve
    >
    > You can try
    >
    > Sub Shapes2()
    > 'Loop through the Shapes collection and use the Type number of the control
    > Dim myshape As Shape
    > For Each myshape In ActiveSheet.Shapes
    > If myshape.Type = 13 Then myshape.Delete
    > Next myshape
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Steve" <[email protected]> wrote in message news:[email protected]...
    > > Thanks guys,
    > >
    > > I went to your link, and I undesrtood the F5-Special-Objects-OK-delete, so I
    > > tried that, and it worked great. However, I also had some macro buttons on
    > > the worksheet that also were deleted ( objects.select). Here's the macro:
    > >
    > > Sheets("test").Select
    > > ActiveSheet.DrawingObjects.Select
    > > Selection.Delete
    > >
    > > There probably is info on your link that will delete all objects but my
    > > macro buttons, but I can't figure it out.
    > >
    > > Thnaks again,
    > >
    > > Steve
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> hi
    > >>
    > >> Mayve the name have a space in it ?
    > >> See
    > >> http://www.rondebruin.nl/controlsobjectsworksheet.htm
    > >>
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "Steve" <[email protected]> wrote in message news:[email protected]...
    > >> >I recorded a macro to delete 3 pictures that are copied onto my spreadsheet
    > >> > every week. However, when I run the macro, I get a run time error stating
    > >> > "item with the specified name not found". Looking at the macro, it indicates
    > >> > shapes ( picture 1), shapes ( picture 2), etc.
    > >> >
    > >> > Is there a fix for this ?
    > >> >
    > >> > Thanks,
    > >> >
    > >> > Steve
    > >>
    > >>
    > >>

    >
    >
    >


  7. #7
    Don Guillett
    Guest

    Re: Macro to delete pictures ?

    does this do it if the button name starts with B

    Sub cutpictures()
    For Each s In ActiveSheet.Shapes
    If Left(s.Name, 1) <> "B" Then s.Cut
    Next

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Steve" <[email protected]> wrote in message
    news:[email protected]...
    > I surely appreciate your help, but I feel shapelessly looped, because I

    don't
    > understand most of the terminology. When I select-all copy the webpage to

    my
    > file, in addition to the data I need, it has 3 pictures that it copies.

    The
    > tab I'm pasting it to also has 2 of my buttons from the forms toolbar that
    > I've assigned macros to. I'd like to be able to delete those 3 pictures,

    but
    > leave my 2 buttons.
    >
    > Sorry that I'm so confused.
    >
    > Steve
    >
    > "Ron de Bruin" wrote:
    >
    > > Hi Steve
    > >
    > > You can try
    > >
    > > Sub Shapes2()
    > > 'Loop through the Shapes collection and use the Type number of the

    control
    > > Dim myshape As Shape
    > > For Each myshape In ActiveSheet.Shapes
    > > If myshape.Type = 13 Then myshape.Delete
    > > Next myshape
    > > End Sub
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > > "Steve" <[email protected]> wrote in message

    news:[email protected]...
    > > > Thanks guys,
    > > >
    > > > I went to your link, and I undesrtood the

    F5-Special-Objects-OK-delete, so I
    > > > tried that, and it worked great. However, I also had some macro

    buttons on
    > > > the worksheet that also were deleted ( objects.select). Here's the

    macro:
    > > >
    > > > Sheets("test").Select
    > > > ActiveSheet.DrawingObjects.Select
    > > > Selection.Delete
    > > >
    > > > There probably is info on your link that will delete all objects but

    my
    > > > macro buttons, but I can't figure it out.
    > > >
    > > > Thnaks again,
    > > >
    > > > Steve
    > > >
    > > > "Ron de Bruin" wrote:
    > > >
    > > >> hi
    > > >>
    > > >> Mayve the name have a space in it ?
    > > >> See
    > > >> http://www.rondebruin.nl/controlsobjectsworksheet.htm
    > > >>
    > > >>
    > > >>
    > > >> --
    > > >> Regards Ron de Bruin
    > > >> http://www.rondebruin.nl
    > > >>
    > > >>
    > > >> "Steve" <[email protected]> wrote in message

    news:[email protected]...
    > > >> >I recorded a macro to delete 3 pictures that are copied onto my

    spreadsheet
    > > >> > every week. However, when I run the macro, I get a run time error

    stating
    > > >> > "item with the specified name not found". Looking at the macro, it

    indicates
    > > >> > shapes ( picture 1), shapes ( picture 2), etc.
    > > >> >
    > > >> > Is there a fix for this ?
    > > >> >
    > > >> > Thanks,
    > > >> >
    > > >> > Steve
    > > >>
    > > >>
    > > >>

    > >
    > >
    > >




  8. #8
    Steve
    Guest

    Re: Macro to delete pictures ?

    Worked great !

    Thanks so much for your patience with me.

    Steve

    "Don Guillett" wrote:

    > does this do it if the button name starts with B
    >
    > Sub cutpictures()
    > For Each s In ActiveSheet.Shapes
    > If Left(s.Name, 1) <> "B" Then s.Cut
    > Next
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "Steve" <[email protected]> wrote in message
    > news:[email protected]...
    > > I surely appreciate your help, but I feel shapelessly looped, because I

    > don't
    > > understand most of the terminology. When I select-all copy the webpage to

    > my
    > > file, in addition to the data I need, it has 3 pictures that it copies.

    > The
    > > tab I'm pasting it to also has 2 of my buttons from the forms toolbar that
    > > I've assigned macros to. I'd like to be able to delete those 3 pictures,

    > but
    > > leave my 2 buttons.
    > >
    > > Sorry that I'm so confused.
    > >
    > > Steve
    > >
    > > "Ron de Bruin" wrote:
    > >
    > > > Hi Steve
    > > >
    > > > You can try
    > > >
    > > > Sub Shapes2()
    > > > 'Loop through the Shapes collection and use the Type number of the

    > control
    > > > Dim myshape As Shape
    > > > For Each myshape In ActiveSheet.Shapes
    > > > If myshape.Type = 13 Then myshape.Delete
    > > > Next myshape
    > > > End Sub
    > > >
    > > >
    > > > --
    > > > Regards Ron de Bruin
    > > > http://www.rondebruin.nl
    > > >
    > > >
    > > > "Steve" <[email protected]> wrote in message

    > news:[email protected]...
    > > > > Thanks guys,
    > > > >
    > > > > I went to your link, and I undesrtood the

    > F5-Special-Objects-OK-delete, so I
    > > > > tried that, and it worked great. However, I also had some macro

    > buttons on
    > > > > the worksheet that also were deleted ( objects.select). Here's the

    > macro:
    > > > >
    > > > > Sheets("test").Select
    > > > > ActiveSheet.DrawingObjects.Select
    > > > > Selection.Delete
    > > > >
    > > > > There probably is info on your link that will delete all objects but

    > my
    > > > > macro buttons, but I can't figure it out.
    > > > >
    > > > > Thnaks again,
    > > > >
    > > > > Steve
    > > > >
    > > > > "Ron de Bruin" wrote:
    > > > >
    > > > >> hi
    > > > >>
    > > > >> Mayve the name have a space in it ?
    > > > >> See
    > > > >> http://www.rondebruin.nl/controlsobjectsworksheet.htm
    > > > >>
    > > > >>
    > > > >>
    > > > >> --
    > > > >> Regards Ron de Bruin
    > > > >> http://www.rondebruin.nl
    > > > >>
    > > > >>
    > > > >> "Steve" <[email protected]> wrote in message

    > news:[email protected]...
    > > > >> >I recorded a macro to delete 3 pictures that are copied onto my

    > spreadsheet
    > > > >> > every week. However, when I run the macro, I get a run time error

    > stating
    > > > >> > "item with the specified name not found". Looking at the macro, it

    > indicates
    > > > >> > shapes ( picture 1), shapes ( picture 2), etc.
    > > > >> >
    > > > >> > Is there a fix for this ?
    > > > >> >
    > > > >> > Thanks,
    > > > >> >
    > > > >> > Steve
    > > > >>
    > > > >>
    > > > >>
    > > >
    > > >
    > > >

    >
    >
    >


  9. #9
    Don Guillett
    Guest

    Re: Macro to delete pictures ?

    glad it worked for you.

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Steve" <[email protected]> wrote in message
    news:[email protected]...
    > Worked great !
    >
    > Thanks so much for your patience with me.
    >
    > Steve
    >
    > "Don Guillett" wrote:
    >
    > > does this do it if the button name starts with B
    > >
    > > Sub cutpictures()
    > > For Each s In ActiveSheet.Shapes
    > > If Left(s.Name, 1) <> "B" Then s.Cut
    > > Next
    > >
    > > --
    > > Don Guillett
    > > SalesAid Software
    > > [email protected]
    > > "Steve" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I surely appreciate your help, but I feel shapelessly looped, because

    I
    > > don't
    > > > understand most of the terminology. When I select-all copy the webpage

    to
    > > my
    > > > file, in addition to the data I need, it has 3 pictures that it

    copies.
    > > The
    > > > tab I'm pasting it to also has 2 of my buttons from the forms toolbar

    that
    > > > I've assigned macros to. I'd like to be able to delete those 3

    pictures,
    > > but
    > > > leave my 2 buttons.
    > > >
    > > > Sorry that I'm so confused.
    > > >
    > > > Steve
    > > >
    > > > "Ron de Bruin" wrote:
    > > >
    > > > > Hi Steve
    > > > >
    > > > > You can try
    > > > >
    > > > > Sub Shapes2()
    > > > > 'Loop through the Shapes collection and use the Type number of the

    > > control
    > > > > Dim myshape As Shape
    > > > > For Each myshape In ActiveSheet.Shapes
    > > > > If myshape.Type = 13 Then myshape.Delete
    > > > > Next myshape
    > > > > End Sub
    > > > >
    > > > >
    > > > > --
    > > > > Regards Ron de Bruin
    > > > > http://www.rondebruin.nl
    > > > >
    > > > >
    > > > > "Steve" <[email protected]> wrote in message

    > > news:[email protected]...
    > > > > > Thanks guys,
    > > > > >
    > > > > > I went to your link, and I undesrtood the

    > > F5-Special-Objects-OK-delete, so I
    > > > > > tried that, and it worked great. However, I also had some macro

    > > buttons on
    > > > > > the worksheet that also were deleted ( objects.select). Here's the

    > > macro:
    > > > > >
    > > > > > Sheets("test").Select
    > > > > > ActiveSheet.DrawingObjects.Select
    > > > > > Selection.Delete
    > > > > >
    > > > > > There probably is info on your link that will delete all objects

    but
    > > my
    > > > > > macro buttons, but I can't figure it out.
    > > > > >
    > > > > > Thnaks again,
    > > > > >
    > > > > > Steve
    > > > > >
    > > > > > "Ron de Bruin" wrote:
    > > > > >
    > > > > >> hi
    > > > > >>
    > > > > >> Mayve the name have a space in it ?
    > > > > >> See
    > > > > >> http://www.rondebruin.nl/controlsobjectsworksheet.htm
    > > > > >>
    > > > > >>
    > > > > >>
    > > > > >> --
    > > > > >> Regards Ron de Bruin
    > > > > >> http://www.rondebruin.nl
    > > > > >>
    > > > > >>
    > > > > >> "Steve" <[email protected]> wrote in message

    > > news:[email protected]...
    > > > > >> >I recorded a macro to delete 3 pictures that are copied onto my

    > > spreadsheet
    > > > > >> > every week. However, when I run the macro, I get a run time

    error
    > > stating
    > > > > >> > "item with the specified name not found". Looking at the macro,

    it
    > > indicates
    > > > > >> > shapes ( picture 1), shapes ( picture 2), etc.
    > > > > >> >
    > > > > >> > Is there a fix for this ?
    > > > > >> >
    > > > > >> > Thanks,
    > > > > >> >
    > > > > >> > Steve
    > > > > >>
    > > > > >>
    > > > > >>
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




+ 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