PDA

View Full Version : replace an icon



lior03
03-01-2007, 01:50 PM
hello all
i want to replace the add sheet command at the add menu with the following
macro:

Sub AddWorksheet5()
On Error Resume Next
Dim response As VbMsgBoxResult
Dim sht As Worksheet
response = MsgBox("Do you want to name the sheet ?" _
, vbQuestion + vbYesNoCancel)
If response = vbYes Then
Set sht = Worksheets.Add
sht.Name = InputBox("enter sheet name")
ElseIf response = vbNo Then Worksheets.Add
Else: Exit Sub
End If
MsgBox "new sheet added as requested.", vbInformation
End Sub


how can i disable the macro attach to a sub menu and force excel to accept my own?.
thanks