Thread: VBA
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default VBA


"PH NEWS" wrote in message
...
Thanks Bob, but that's a bit over my head. I can't decipher between what I
need and what I don't need. I don't protect the sheet with a button it is
already protected.


I understand that, but when it gets unprotected (via your button) you want
it protected again, so I was suggesting adding another button for that where
you can add your specific code (as I showed).

Could you tell me which part(s) of those codes I need if
all I want the button to do is unprotect the sheet for five minutes. This
would be a massive help.


You could add this to your unprotect button code.


Dim Time As Double

nTime = Now + TimeSerial(0, 5, 0) '5 minutes
Application.OnTime nTime, "ProtectSheet"

and then just put this next macro into a standard code module.

Sub ProtectSheet()
ActiveSheet.Protect
End Sub