error message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

is their a way to create your own error message

have a work book with protected cells , can i get the default message to
read something like

you arre not authorised to alter this data
 
You can't change the message, but you can stop them from selecting locked cells
on a protected sheet.

Option Explicit
Sub auto_open()
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
With wks
.Protect password:="hi"
.EnableSelection = xlUnlockedCells
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Back
Top