Removing Buttons

I copied buttons from a WEB page into an EXCEL 
spreadsheet.  I tried to remove the buttons using edit/go 
to/special/objects  -- but it says 'no objects found'.  I 
also tried to 'right click' the button and cut - but it 
did not work either.  I can send you a sample if possible.
0
anonymous (74722)
7/15/2004 4:09:25 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
496 Views

Similar Articles

[PageSpeed] 1

If there's no shapes you want to keep, maybe this'll do it for you.

(Save your file first--just in case.)

Option Explicit
Sub testme()

    Dim iCtr As Long
    Dim myErrNumber As Long
    
    With ActiveSheet
        .Shapes.SelectAll
        On Error Resume Next
        Selection.Delete
        myErrNumber = Err.Number
        On Error GoTo 0
        
        If myErrNumber <> 0 Then
            For iCtr = .Shapes.Count To 1 Step -1
                .Shapes(iCtr).Delete
            Next iCtr
            Err.Clear
        End If
    End With
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

Steven Stadelhofer wrote:
> 
> I copied buttons from a WEB page into an EXCEL
> spreadsheet.  I tried to remove the buttons using edit/go
> to/special/objects  -- but it says 'no objects found'.  I
> also tried to 'right click' the button and cut - but it
> did not work either.  I can send you a sample if possible.

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
7/15/2004 11:53:35 PM
Dave,

Thanks for reply and sorry for the delayed re-post.  I 
was trying to use your macro but got several error msg.  
Since I am not real familiar with writing and using 
macros are you aware of a way to remove buttons without 
using a macro?

Thanks Steve 

>-----Original Message-----
>If there's no shapes you want to keep, maybe this'll do 
it for you.
>
>(Save your file first--just in case.)
>
>Option Explicit
>Sub testme()
>
>    Dim iCtr As Long
>    Dim myErrNumber As Long
>    
>    With ActiveSheet
>        .Shapes.SelectAll
>        On Error Resume Next
>        Selection.Delete
>        myErrNumber = Err.Number
>        On Error GoTo 0
>        
>        If myErrNumber <> 0 Then
>            For iCtr = .Shapes.Count To 1 Step -1
>                .Shapes(iCtr).Delete
>            Next iCtr
>            Err.Clear
>        End If
>    End With
>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
>
>Steven Stadelhofer wrote:
>> 
>> I copied buttons from a WEB page into an EXCEL
>> spreadsheet.  I tried to remove the buttons using 
edit/go
>> to/special/objects  -- but it says 'no objects 
found'.  I
>> also tried to 'right click' the button and cut - but it
>> did not work either.  I can send you a sample if 
possible.
>
>-- 
>
>Dave Peterson
>ec35720@msn.com
>.
>
0
anonymous (74722)
7/22/2004 7:11:39 PM
Reply:

Similar Artilces: