Hi,
The code below will produce a Message Box with your copyright details and a Yes and No Button. If you click "Yes" the sheet will remain open, if you click "No" the sheet will close.
The code below must be entered in a "Workbook_ Open" event code window.
Do this as follows:-
Open the desired workbook and Click "Alt + F11"--- code window appears.
If its blank or there is no left hand pane, Click "Ctrl +R" ---Project window appears on left of code window
In the Project window you will see the sheet numbers, at the bottom of the sheet numbers you will see the words "This Workbook", double click it. Workbook code window appears on right.
At the top of the this right hand window, on the left hand side there is a drop down box. Select "Workbook"
On the right hand side there is another drop down box. Select "Open" from the list.
A "Workbook_Open" Event will appear in the code window.
Paste the code below into it.
(Between the words "Workbook_Open and End Sub")
Edit the code with the correct Workbook name, where it shows "My Worksheet.xls"
Edit the text to suit, if you get a problem let me know.
Dim ans As String
ans = MsgBox("This spreadsheet is copyrighted " _
& "to *insert name here*" & vbNewLine & _
"and may not be distributed, altered, etc etc.." _
& vbNewLine & vbNewLine & "Clicking ""OK"" consitutes" _
& " consent and etc etc.", vbYesNo, "Copyright Notice")
If ans = vbNo Then Workbooks("My Workbook.xls").Close
Regards
Mick
Bookmarks