daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Nov 17th, 2017 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function findPassword()
  2.  
  3. 'Breaks worksheet password protection.
  4. Dim i As Integer, j As Integer, k As Integer
  5. Dim l As Integer, m As Integer, n As Integer
  6. Dim i1 As Integer, i2 As Integer, i3 As Integer
  7. Dim i4 As Integer, i5 As Integer, i6 As Integer
  8. On Error Resume Next
  9. For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
  10. For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
  11. For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
  12. For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
  13. ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
  14.     Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
  15.     Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
  16. If ActiveSheet.ProtectContents = False Then
  17.     MsgBox "One usable password is " & Chr(i) & Chr(j) & _
  18.         Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
  19.         Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
  20.      Exit Function
  21. End If
  22. Next: Next: Next: Next: Next: Next
  23. Next: Next: Next: Next: Next: Next
  24.  
  25. End Function
RAW Paste Data
Top