A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

cells protection



 
 
Thread Tools Display Modes
  #1  
Old February 8th, 2009, 07:59 PM
tofimoon3 tofimoon3 is offline
Member
 
First recorded activity by OfficeFrustration: Jan 2009
Posts: 8
Default cells protection

Dear sir, with my regards, i have a workbook with about ( 10 sheets) full of formulas,to send these formulas away from spongers , i protcted some cells or columns which contain them, when i want to work on any sheet i cancell the protection and forget to protect again .
Is there any way in excell 2003 to protect these cells directly when i close the sheets.
Thanks in advance.
  #2  
Old February 8th, 2009, 08:39 PM posted to microsoft.public.excel.newusers
CurlyDave
external usenet poster
 
Posts: 112
Default cells protection

Sure with VBA.
Place this code in a workbook module, if you don't know where that is,
check out this site
http://www.contextures.com/xlvba01.html#Workbook

Place this code there

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim Shts As Worksheet

For Each Shts In ThisWorkbook.Worksheets
Shts.Protect Password:="123"
Next
end sub
  #3  
Old February 8th, 2009, 08:43 PM posted to microsoft.public.excel.newusers
muddan madhu
external usenet poster
 
Posts: 695
Default cells protection

press alt + f11 , click this workbook ( left hand side )

Insert this code

Private Sub Workbook_BeforeClose(Cancel As Boolean)
For a = 1 To Sheets.Count
Worksheets(a).Protect
Next
End Sub



On Feb 9, 12:59*am, tofimoon3
wrote:
Dear sir, with my regards, i have a workbook with about ( 10 sheets)
full of formulas,to send these formulas away from spongers , i protcted
some cells or columns which contain them, when i want to work on any
sheet i cancell the protection and forget to protect again .
Is there any way in excell 2003 to protect these cells directly when i
close the sheets.
Thanks in advance.

--
tofimoon3


  #4  
Old February 9th, 2009, 08:04 PM
tofimoon3 tofimoon3 is offline
Member
 
First recorded activity by OfficeFrustration: Jan 2009
Posts: 8
Default

Quote:
Originally Posted by muddan madhu View Post
press alt + f11 , click this workbook ( left hand side )

Insert this code

Private Sub Workbook_BeforeClose(Cancel As Boolean)
For a = 1 To Sheets.Count
Worksheets(a).Protect
Next
End Sub



On Feb 9, 12:59*am, tofimoon3
wrote:
Dear sir, with my regards, i have a workbook with about ( 10 sheets)
full of formulas,to send these formulas away from spongers , i protcted
some cells or columns which contain them, when i want to work on any
sheet i cancell the protection and forget to protect again .
Is there any way in excell 2003 to protect these cells directly when i
close the sheets.
Thanks in advance.

--
tofimoon3
Dear sirs,with my appreciation for your replies,i failed to reach the goal when all the formulas in my workbook have appeared after using the code .
Can you tell me please the way to activate your solutions.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.