Thanks for the example XLD, I just have a couple more questions.
Using your example, I've put this together (Still Incomplete):
Sub AddWorksheetEventProc()
Dim StartLine As Long
Dim WSName As String
'Sheet "Joe" is used as the template---WSName will be the name of the
'copied worksheet
WSName = Application.InputBox("What is the Sheet Name?", Type:=2)
If WSName = "" Then
MsgBox "Sheet will not be created. There is no name for it.", _
vbOKOnly + vbExclamation, "No new sheet"
Exit Sub
End If
'This line works with Excel 2003, but not with Excel 2000...What's the syntax?
'And how do I set the WSName to the new sheet??
Sheets("Joe").Copy 'Before:=Sheets("Joe)
With ActiveWorkbook.VBProject.VBComponents(WSName.CodeName).CodeModule
StartLine = .CreateEventProc("Change", "Worksheet") + 1
.InsertLines StartLine, _
"Dim ans" & vbCrLf & _
" ans = Msgbox( ""All OK"",vbYesNo)" & vbCrLf & _
" If ans = vbNo Then Cancel = True"
End With
End Sub
How do you set the name for the new worksheet? And How do I fix that line that sorts the new sheet before "Joe" for the correct Excel 2000 syntax?