View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Vic Eldridge Vic Eldridge is offline
external usenet poster
 
Posts: 50
Default Is there a Sheet delete property?

(Rick De Marco) wrote in message . com...
Does anyone have any ideas on my original question? See my first post
in this message??


Yes, make Excel's two Delete Sheet buttons run your own macro instead.

Private Sub Workbook_Open()
CommandBars("Edit").FindControl(ID:=847).OnAction = "MySheetDeleteMacro"
CommandBars("Ply").FindControl(ID:=847).OnAction = "MySheetDeleteMacro"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
CommandBars("Edit").FindControl(ID:=847).OnAction = ""
CommandBars("Ply").FindControl(ID:=847).OnAction = ""
End Sub

Sub MySheetDeleteMacro()
MsgBox "Do you really want to delete " & ActiveSheet.Name & " ?"
End Sub


Regards,
Vic Eldridge