Excel password protection

Source: Internet
Author: User
Tags password protection

1. Enable Macros
2. Record macro (Passbreak after entering macro name)
3. View macro---Edit
4.vb Editor Delete system automatically generated code enter the following code, save
5. Run the macro

The code is as follows:

Sub Passbreak ()
Dim I As Integer, J As Integer, K as Integer
Dim l As Integer, M as Integer, n as Integer
Dim i1 As Integer, I2 As Integer, i3 as Integer
Dim I4 As Integer, i5 as Integer, I6 as Integer
On Error Resume Next
For i = 66:for j = 66:for k = 66
For L = 66:for m = 66:for I1 = 66
For i2 = 66:for i3 = 66:for I4 = 66
For i5 = 66:for I6 = All to 66:for n = 126
ActiveSheet.Unprotect chr (i) & Chr (j) & Chr (k) & _
Chr (L) & Chr (M) & Chr (i1) & Chr (i2) & Chr (i3) & _
Chr (I4) & Chr (i5) & Chr (I6) & Chr (n)
If activesheet.protectcontents = False Then
MsgBox "One usable password is" & Chr (i) & Chr (j) & _
Chr (k) & Chr (L) & Chr (M) & Chr (i1) & Chr (I2) & _
Chr (i3) & Chr (I4) & Chr (i5) & Chr (I6) & Chr (n)
ActiveWorkbook.Sheets (1). Select
Range ("A1"). FORMULAR1C1 = Chr (i) & Chr (j) & _
Chr (k) & Chr (L) & Chr (M) & Chr (i1) & Chr (I2) & _
Chr (i3) & Chr (I4) & Chr (i5) & Chr (I6) & Chr (n)
Exit Sub
End If
Next:Next:Next:Next:Next:Next
Next:Next:Next:Next:Next:Next
End Sub

Excel password protection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.