#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default 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!!!
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
delete a macro that isn't in macro list Jane Makinson Excel Discussion (Misc queries) 3 March 13th 06 01:10 PM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
VBA, delete all macro Danny Excel Worksheet Functions 3 January 27th 06 06:13 PM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
Macro to delete a row kiran Excel Discussion (Misc queries) 1 September 1st 05 06:45 AM


All times are GMT +1. The time now is 08:58 AM.

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

About Us

"It's about Microsoft Excel"