Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protection on Multiple Sheets

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Protection on Multiple Sheets

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protection on Multiple Sheets

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub


I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub


"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia


--

Dave Peterson
.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Protection on Multiple Sheets

If you hit alt-F8, you should see a list of macros available to you.

Select the "UnprotectAllSheets" macro and click Run.

If the list doesn't include these macros, then make sure you put the code into
the correct location.

If the macro starts, then stops with an error message, you'll have to share how
it broke--what line caused the trouble.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Sophie wrote:

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub

"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia


--

Dave Peterson
.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protection on Multiple Sheets

Ok this was too time consuming. I just need a code to put to protect all the
worksheets and then unprotect them when needed. Can you supply me with that?



Thanks,

"Dave Peterson" wrote:

If you hit alt-F8, you should see a list of macros available to you.

Select the "UnprotectAllSheets" macro and click Run.

If the list doesn't include these macros, then make sure you put the code into
the correct location.

If the macro starts, then stops with an error message, you'll have to share how
it broke--what line caused the trouble.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Sophie wrote:

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub

"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia

--

Dave Peterson
.


--

Dave Peterson
.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Protection on Multiple Sheets

You have the code.

I don't think I could make any meaningful changes to what you have.

Sophie wrote:

Ok this was too time consuming. I just need a code to put to protect all the
worksheets and then unprotect them when needed. Can you supply me with that?

Thanks,

"Dave Peterson" wrote:

If you hit alt-F8, you should see a list of macros available to you.

Select the "UnprotectAllSheets" macro and click Run.

If the list doesn't include these macros, then make sure you put the code into
the correct location.

If the macro starts, then stops with an error message, you'll have to share how
it broke--what line caused the trouble.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Sophie wrote:

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub

"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protection on Multiple Sheets

When I put unprotect all it gives me an error and to fix it.

Gord can you help??? You always help me with my absurd questions. Can you
provide me with a code that will work and walk me through the process to put
this in place?

Thanks,

"Dave Peterson" wrote:

You have the code.

I don't think I could make any meaningful changes to what you have.

Sophie wrote:

Ok this was too time consuming. I just need a code to put to protect all the
worksheets and then unprotect them when needed. Can you supply me with that?

Thanks,

"Dave Peterson" wrote:

If you hit alt-F8, you should see a list of macros available to you.

Select the "UnprotectAllSheets" macro and click Run.

If the list doesn't include these macros, then make sure you put the code into
the correct location.

If the macro starts, then stops with an error message, you'll have to share how
it broke--what line caused the trouble.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Sophie wrote:

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub

"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Protection on Multiple Sheets

You posted three macros, all of which should work.

1. Protect all sheets

2. Unprotect all sheets

3. Protect selected sheets.

All three of these should be stored in a General module in your workbook.

If you used 1 to protect all sheets there is no reason that 2 will not
unprotect all sheets.

I will not provide any different macros. You should be able to figure out
how to create a fourth macro to unprotect selected sheets if you need one.

Please post the line where you get the error on the macro UnprotectAllSheets


Gord


On Fri, 26 Feb 2010 09:59:01 -0800, Sophie
wrote:

When I put unprotect all it gives me an error and to fix it.

Gord can you help??? You always help me with my absurd questions. Can you
provide me with a code that will work and walk me through the process to put
this in place?

Thanks,

"Dave Peterson" wrote:

You have the code.

I don't think I could make any meaningful changes to what you have.

Sophie wrote:

Ok this was too time consuming. I just need a code to put to protect all the
worksheets and then unprotect them when needed. Can you supply me with that?

Thanks,

"Dave Peterson" wrote:

If you hit alt-F8, you should see a list of macros available to you.

Select the "UnprotectAllSheets" macro and click Run.

If the list doesn't include these macros, then make sure you put the code into
the correct location.

If the macro starts, then stops with an error message, you'll have to share how
it broke--what line caused the trouble.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Sophie wrote:

I used the following code:

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

I did the following:

Copied and pasted it into the VBA and ran the macro and saved changes but
then what do I do? How do I get it to unprotect?

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub

"Dave Peterson" wrote:

You may want to share the code you tried and explain why it didn't work.

Sophie wrote:

I have several sheets in one workbook that i want to protect all with the
same password. I tried some of the codes that were given but they did not
work for me. Can some one please help? Also if you can explain it thouroughly
for me as I am still learning this whole new macro thing.

In advance thanks

-Sofia

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protection of many sheets Adam Excel Worksheet Functions 13 December 16th 09 05:08 PM
help with protection of sheets des-sa[_2_] Excel Discussion (Misc queries) 3 July 17th 08 04:27 PM
Applying Protection To Multiple Sheets Mhz New Users to Excel 4 July 6th 06 01:22 PM
Password protection for Excel sheets Alejandro Excel Discussion (Misc queries) 2 April 13th 05 03:33 PM
Protection and Hiding Sheets JudithJubilee Excel Discussion (Misc queries) 4 March 4th 05 02:16 PM


All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"