# Excel - IF Function Problem - Expert Solution

Question description:
This user has given permission to use the problem statement for this blog.

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 = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 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
Solved by I. A. in 11 mins
This is the chat thread from the real Excelchat help session. It contains no private user information.
Excelchat Expert 13/12/2017 - 05:35
welcome and thank you sir for selecting get it pro
Excelchat Expert 13/12/2017 - 05:35
User 13/12/2017 - 05:36
hi
User 13/12/2017 - 05:36
can you help me to understanding this coding?
Excelchat Expert 13/12/2017 - 05:36
yes sir
User 13/12/2017 - 05:36
thanks
Excelchat Expert 13/12/2017 - 05:37
this programming is for breaking the password of work sheet
Excelchat Expert 13/12/2017 - 05:37
first define the sub procedure
Excelchat Expert 13/12/2017 - 05:38
then define the variables i,j,k , l,m,n ,i1...up to i6
Excelchat Expert 13/12/2017 - 05:39
and dim is used for store the value of varible in it
Excelchat Expert 13/12/2017 - 05:39
we define the data range of variable is an integer
Excelchat Expert 13/12/2017 - 05:39
so in variable integer value will be stored
Excelchat Expert 13/12/2017 - 05:40
then we use the for loop and next is its key word
Excelchat Expert 13/12/2017 - 05:40
next suggest the next step
Excelchat Expert 13/12/2017 - 05:40
activesheet is suggest for active sheet
Excelchat Expert 13/12/2017 - 05:41
and . is a dot operator
Excelchat Expert 13/12/2017 - 05:41
after the . dot value any command is mentioned like unprotect , open , fill etc...
Excelchat Expert 13/12/2017 - 05:41
then
Excelchat Expert 13/12/2017 - 05:42
msgbox is used for display the message box
Excelchat Expert 13/12/2017 - 05:42
then we have to close the sub procedure and if statement
User 13/12/2017 - 05:43
and what is mean by .select ?
Excelchat Expert 13/12/2017 - 05:43
.select is used for selecting the any cell or sheet
Excelchat Expert 13/12/2017 - 05:43
any other help do you need?
User 13/12/2017 - 05:43
no thanks
User 13/12/2017 - 05:44
yes
User 13/12/2017 - 05:44
very much
Excelchat Expert 13/12/2017 - 05:44
are you satisfied with this solution?
User 13/12/2017 - 05:44
yes
Excelchat Expert 13/12/2017 - 05:44
can i close this session?
User 13/12/2017 - 05:44
yes
Excelchat Expert 13/12/2017 - 05:44
Excelchat Expert 13/12/2017 - 05:44
see you
Excelchat Expert 13/12/2017 - 05:44
good bye
Excelchat Expert 13/12/2017 - 05:45
nice to meet you
User 13/12/2017 - 05:45
bye

This is the output file from the real Excelchat help session:
This is an example of the expert help you can get. It contains no private user information.

Get instant expert help with Excel and Google Sheets

#### Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Your privacy is guaranteed. Your session will not be used for blog unless you give us persmission.