ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete Macro (https://www.excelbanter.com/excel-discussion-misc-queries/217958-delete-macro.html)

Pamela[_3_]

Delete Macro
 
Hi Guys!!!
I added this code this code and now I want to delete it:

Private Sub Workbook_Open()
'If you have different passwords
'for each Worksheet.
Sheets(1).Protect Password:="Secret", _
UserInterFaceOnly:=True


Sheets(3).Protect Password:="Secret", _
UserInterFaceOnly:=True


'Repeat as needed.
End Sub

I when inside (alt F11) and selected and delete but when I reopen the
workbook still is protected.
How I can delete the proteccion from the workbook?

thank you:
Pamela xoxo

Gord Dibben

Delete Macro
 
The last statement in your now-deleted code protected the worksheets.

Deleting the code does not unprotect them.

Run this macro to unprotect all the sheets then save the workbook again.

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


Gord Dibben MS Excel MVP


On Mon, 26 Jan 2009 15:55:44 -0800 (PST), Pamela
wrote:

Hi Guys!!!
I added this code this code and now I want to delete it:

Private Sub Workbook_Open()
'If you have different passwords
'for each Worksheet.
Sheets(1).Protect Password:="Secret", _
UserInterFaceOnly:=True


Sheets(3).Protect Password:="Secret", _
UserInterFaceOnly:=True


'Repeat as needed.
End Sub

I when inside (alt F11) and selected and delete but when I reopen the
workbook still is protected.
How I can delete the proteccion from the workbook?

thank you:
Pamela xoxo



Pamela[_3_]

Delete Macro
 
On Jan 26, 4:42*pm, Gord Dibben <gorddibbATshawDOTca wrote:
The last statement in your now-deleted code protected the worksheets.

Deleting the code does not unprotect them.

Run this macro to unprotect all the sheets then save the workbook again.

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

Gord Dibben *MS Excel MVP

On Mon, 26 Jan 2009 15:55:44 -0800 (PST), Pamela
wrote:



Hi Guys!!!
I added this code this code and now I want to delete it:


Private Sub Workbook_Open()
'If you have different passwords
'for each Worksheet.
Sheets(1).Protect Password:="Secret", _
UserInterFaceOnly:=True


Sheets(3).Protect Password:="Secret", _
UserInterFaceOnly:=True


'Repeat as needed.
End Sub


I when inside (alt F11) and selected and delete but when I reopen the
workbook still is protected.
How I can delete the proteccion from the workbook?


thank you:
Pamela xoxo- Hide quoted text -


- Show quoted text -


Thank you!!!


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com