> **V**isual **B**asic For **A**pplications
A horrible language that has no place in production systems.
- Related: [[Excel|s.apps.excel]]
- [Wise Owl Tutorials](https://www.youtube.com/c/WiseOwlTutorials)
- [MSDN official Docs](https://docs.microsoft.com/en-us/office/vba/api/overview/excel)
- [Analyst Cave](https://analystcave.com/excel-vba-tutorial/)
- [Automate Excel](https://www.automateexcel.com/learn-vba-tutorial/)
- [Excel Automation](https://www.rondebruin.nl/win/s1/outlook/mail.htm)
- [Auto Macro](https://www.automateexcel.com/vba-code-generator#shortcuts)
- [Cpearson](http://www.cpearson.com/Excel/Topic.aspx)
- Rubber Duck IDE
- [Rubber Duck GitHub](https://github.com/rubberduck-vba/Rubberduck/)
- [Rubber Duck Website](https://rubberduckvba.com/)
- [Learn Excel Macro](http://learnexcelmacro.com/wp/download/)
## Tips and Tricks
### Unlock Protected sheets
```vb
Option Explicit
Sub GetPass()
Const a = 65, b = 66, c = 32, d = 126
Dim i#, j#, k#, l#, m#, n#, o#, p#, q#, r#, s#, t#
With ActiveSheet
If .ProtectContents Then
On Error Resume Next
For i = a To b
For j = a To b
For k = a To b
For l = a To b
For m = a To b
For n = a To b
For o = a To b
For p = a To b
For q = a To b
For r = a To b
For s = a To b
For t = c To d
.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & _
Chr(n) & Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)
Next t
Next s
Next r
Next q
Next p
Next o
Next n
Next m
Next l
Next k
Next j
Next i
MsgBox "Finished"
End If
End With
End Sub
```
1. Open protected Sheet
2. <kbd>ALT</kbd> + <kbd>F11</kbd>
3. Double click worksheet name in the interface
4. paste code from above
5. <kbd>F5</kbd>
6. code will run and crack the algorithm