![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
protect workbook
Hello.
I have a file that has 7 sheets. I want to protect it so that it can be viewed but not edited. I know how to do this by sheet but when I do 'protect workbook' it makes no difference. how do you do it in one go rather than going into every sheet and protecting it and then having to unprotect 7 times when I'm using it. Thank you |
|
|||
|
Re: protect workbook
On May 18, 8:51 pm, "JB" <somehow@somewhere> wrote:
> Hello. > > I have a file that has 7 sheets. I want to protect it so that it can be > viewed but not edited. > I know how to do this by sheet but when I do 'protect workbook' it makes no > difference. how do you do it in one go rather than going into every sheet > and protecting it and then having to unprotect 7 times when I'm using it. > > Thank you Use macros to protect and unprotect all the sheets. Maybe... Public Sub ProtectAllSheets() Application.ScreenUpdating = False Dim Sht As Object On Error Resume Next For Each Sht In ThisWorkbook.Sheets Sht.Protect "password" 'change to your password Next Sht End Sub Public Sub UnProtectAllSheets() Application.ScreenUpdating = False Dim Sht As Object On Error Resume Next For Each Sht In ThisWorkbook.Sheets Sht.Unprotect "password" 'change to your password Next Sht End Sub |
|
|||
|
Re: protect workbook
Thank you I'll try that
"Ken Johnson" <KenCJohnson@gmail.com> wrote in message news:7a252995-4e06-417f-8ee0-988445aef5e0@d19g2000prm.googlegroups.com... > On May 18, 8:51 pm, "JB" <somehow@somewhere> wrote: >> Hello. >> >> I have a file that has 7 sheets. I want to protect it so that it can be >> viewed but not edited. >> I know how to do this by sheet but when I do 'protect workbook' it makes >> no >> difference. how do you do it in one go rather than going into every sheet >> and protecting it and then having to unprotect 7 times when I'm using it. >> >> Thank you > > Use macros to protect and unprotect all the sheets. Maybe... > > Public Sub ProtectAllSheets() > Application.ScreenUpdating = False > Dim Sht As Object > On Error Resume Next > For Each Sht In ThisWorkbook.Sheets > Sht.Protect "password" 'change to your password > Next Sht > End Sub > > Public Sub UnProtectAllSheets() > Application.ScreenUpdating = False > Dim Sht As Object > On Error Resume Next > For Each Sht In ThisWorkbook.Sheets > Sht.Unprotect "password" 'change to your password > Next Sht > End Sub |
|
|||
|
Re: protect workbook
On May 23, 6:38 am, "JB" <somehow@somewhere> wrote:
> Thank you I'll try that > > "Ken Johnson" <KenCJohn...@gmail.com> wrote in message > > news:7a252995-4e06-417f-8ee0-988445aef5e0@d19g2000prm.googlegroups.com... > > > On May 18, 8:51 pm, "JB" <somehow@somewhere> wrote: > >> Hello. > > >> I have a file that has 7 sheets. I want to protect it so that it can be > >> viewed but not edited. > >> I know how to do this by sheet but when I do 'protect workbook' it makes > >> no > >> difference. how do you do it in one go rather than going into every sheet > >> and protecting it and then having to unprotect 7 times when I'm using it. > > >> Thank you > > > Use macros to protect and unprotect all the sheets. Maybe... > > > Public Sub ProtectAllSheets() > > Application.ScreenUpdating = False > > Dim Sht As Object > > On Error Resume Next > > For Each Sht In ThisWorkbook.Sheets > > Sht.Protect "password" 'change to your password > > Next Sht > > End Sub > > > Public Sub UnProtectAllSheets() > > Application.ScreenUpdating = False > > Dim Sht As Object > > On Error Resume Next > > For Each Sht In ThisWorkbook.Sheets > > Sht.Unprotect "password" 'change to your password > > Next Sht > > End Sub I hope all goes well. Ken Johnson |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|