Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a procedure run by a commandbutton on 1 worksheet that copies
another worksheet to a 3rd worksheet. The procedure then is supposed to delete the commandbuttons on the newly copied worksheet. It deletes the 1st one ok but ends in a 1004 error when trying to delete the 2nd button. What am I doning wrong...thx here is the code for the deletion of the objects... Option Compare Text Dim strMainWks As String Dim strTmpWks As String Dim wsCurWks As Worksheet Dim rSortRange As Range Dim rMyRange As Range Dim rMyCell As Range Dim rMyDeletion As Range Sub deletebtns_Click() Dim wsCurWks As Worksheet Dim Obj As OLEObject Set wsCurWks = ActiveSheet For Each Obj In ActiveSheet.OLEObjects If InStr(1, Obj.ProgId, "CommandButton") < 0 Then 'MsgBox Obj.ProgId Obj.Delete End If Next Obj End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copied formulas refer to destination sheet not source sheet | Excel Worksheet Functions | |||
Delete graphics copied from a Web page | Excel Discussion (Misc queries) | |||
Delete the formulas of webpage, copied & pasted on excel sheet | Excel Discussion (Misc queries) | |||
Do While, OnTime and CommandButtons | Excel Programming | |||
commandbuttons properties | Excel Programming |