View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Disallow changes once expiry reached

Edmund,
Would it not be easier to have code in the _BeforeSave event ?
<Pseudo Code
If (WB.IsDirty=True) And (Date CutOffdate) Then
msgbox "Too late for changes"
Else
.save
End

You can set the IsDirty in the WS change events, if the range is in rows
1-50.
Also, you can set the .ScrollArea and EnableSelection properties, but these
only function if the sheet is protected.

Otherwise maintain a copy of the required range of the first 50 rows and if
any are chnage, reset them with a msgbox to the user.

NickHK

"Edmund" wrote in message
...
Like a simple event, I need a set of codes that will automatically

disallow
changes in Sheet1 from row1 to 50, once the date turns 1/1/2007 and

onwards.

When I say "disallow changes" it must be very gross. Perhaps just prevent
users from being able to select any cell within the range (but yet cell

must
be visible to user) or perhaps make it that whatever entry made into the
range will be rejected.

Sheet Protection won't work because I suspect some users have tools to

break
it. But if I store your codes in VBA & protect from view, this will be a

lot
better.

Nevermind if users disable Macro on open. I have managed to take care of
this already.

Any help or method would be much appreciated.

--
Edmund
(Using Excel XP)