Results 1 to 17 of 17

Protect / Unprotect Macro

Threaded View

jason.hampton Protect / Unprotect Macro 04-20-2012, 06:11 PM
Mallycat Re: Protect / Unprotect Macro 04-20-2012, 07:10 PM
jason.hampton Re: Protect / Unprotect Macro 04-20-2012, 07:47 PM
john55 Re: Protect / Unprotect Macro 04-21-2012, 01:51 AM
royUK Re: Protect / Unprotect Macro 04-21-2012, 02:40 AM
jason.hampton Re: Protect / Unprotect Macro 04-21-2012, 03:59 PM
Mallycat Re: Protect / Unprotect Macro 04-21-2012, 07:11 PM
jason.hampton Re: Protect / Unprotect Macro 04-24-2012, 09:56 AM
Mallycat Re: Protect / Unprotect Macro 04-25-2012, 01:58 AM
jason.hampton Re: Protect / Unprotect Macro 04-25-2012, 10:25 PM
Mallycat Re: Protect / Unprotect Macro 04-26-2012, 05:04 AM
jason.hampton Re: Protect / Unprotect Macro 05-01-2012, 01:42 PM
Mallycat Re: Protect / Unprotect Macro 05-01-2012, 06:26 PM
john55 Re: Protect / Unprotect Macro 05-02-2012, 12:42 AM
Mallycat Re: Protect / Unprotect Macro 05-02-2012, 07:45 PM
jason.hampton Re: Protect / Unprotect Macro 05-07-2012, 04:28 PM
Mallycat Re: Protect / Unprotect Macro 06-06-2012, 03:36 AM
  1. #1
    Forum Contributor jason.hampton's Avatar
    Join Date
    04-20-2012
    Location
    Republic of Texas
    MS-Off Ver
    2007, 2010, 2016
    Posts
    138

    Protect / Unprotect Macro

    Greetings! This is my first post.

    I am using Office 2007 Prof. I found a web site for a "Proect / Unprotect" macro instructions. http://www.ozgrid.com/VBA/excel-work...rotect-all.htm

    My question is, can the code in the above proceedure be modified so it asks you to enter your password twice to check for accuracy?

    ~*~*~*~*~*~*~*~*~*~
    Private Sub CommandButton1_Click()
    
    Dim wSheet As Worksheet
    
    	For Each wSheet In Worksheets
    
    		If wSheet.ProtectContents = True Then
    
    			wSheet.Unprotect Password:=TextBox1.Text
    
    		Else
    
    			wSheet.Protect Password:=TextBox1.Text
    
    		End If
    
    	Next wSheet
    
    Unload me
    
    End Sub
    ~*~*~*~*~*~*~*~*

    Best Regards,
    Jason Hampton
    Last edited by jason.hampton; 04-23-2012 at 05:41 PM. Reason: Needed to add [code]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1