Re: If then else
- From: dok112 <dok112.23e8ty_1140213603.8591@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Feb 2006 15:56:22 -0600
Here is the updated code to "re-lock" the fields when the file is
closing. If you dont want a password, but want the sheets still
locked, then you can just leave off the "password" portion
(WSN.Protect) (Unprotect), and it will lock the book without a
password. I also added a line to the end to force the book to be saved
so they dont have the option of closing out without saving. If you want
to re-instate that option, just remove that line from the code.
Dim r As Variant
Dim WSN As Variant
Set WSN = ThisWorkbook.Sheets("TimeCard")
r = 9
Do Until WSN.Cells(r, 10).Value = ""
If WSN.Cells(r, 10).Value = "Tardy" And WSN.Cells(r, 11).Value = ""
Then
MsgBox "Please enter the amount of time tardy"
Cancel = True
Exit Do
Exit Sub
Else:
r = r + 1
End If
Loop
WSN.Protect "same password"
thisworkbook.close (true)
--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=10581
View this thread: http://www.excelforum.com/showthread.php?threadid=513772
.
- Follow-Ups:
- Re: If then else
- From: jprogrammer
- Re: If then else
- From: jprogrammer
- Re: If then else
- From: jprogrammer
- Re: If then else
- References:
- If then else
- From: jprogrammer
- Re: If then else
- From: dok112
- Re: If then else
- From: glen . e . mettler
- Re: If then else
- From: dok112
- Re: If then else
- From: dok112
- Re: If then else
- From: jprogrammer
- Re: If then else
- From: dok112
- Re: If then else
- From: jprogrammer
- Re: If then else
- From: dok112
- If then else
- Prev by Date: Re: Fork Truck database
- Next by Date: Re: Row Color based on cell entry
- Previous by thread: Re: If then else
- Next by thread: Re: If then else
- Index(es):
Relevant Pages
|