Subscribe for Weekly Tutorials
BONUS: subscribe now to download our Top Tutorials Ebook!
Simplify VBA Coding for Common Functions
' These modules exist just to make other VBA code easier to write and more readable
' For example, you can just enter "NormalErrorProcessing" in your code
' instead of "On Error GoTo 0"
Sub NormalErrorProcessing()
On Error GoTo 0
End Sub
Sub NoErrorProcessing()
On Error Resume Next
End Sub
Sub EnableScreenUpdating()
Application.ScreenUpdating = True
End Sub
Sub DisableScreenUpdating()
Application.ScreenUpdating = False
End Sub
Sub HideGridlines()
ActiveWindow.DisplayGridlines = False
End Sub
Sub ShowGridlines()
ActiveWindow.DisplayGridlines = True
End Sub
Sub ToggleGridlines()
ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub
Sub TurnOffCalc()
Application.Calculation = xlCalculationManual
End Sub
Sub TurnOnCalc()
Application.Calculation = xlCalculationAutomatic
End Sub
Sub ForceFullCalc()
ActiveWorkbook.ForceFullCalculation = True
End Sub
Sub EnableEvents()
Application.EnableEvents = True
End Sub
Sub DisableEvents()
Application.EnableEvents = False
End Sub
Sub UnProtectSheet()
ActiveSheet.Unprotect
End Sub
Sub TurnOnFormulaBar()
Application.DisplayFormulaBar = True
End Sub
Sub TurnOffFormulaBar()
Application.DisplayFormulaBar = False
End Sub
Sub ToggleFormulaDisplay()
ActiveWindow.DisplayFormulas = Not ActiveWindow.DisplayFormulas
End Sub
Sub TurnOffFilters()
ActiveSheet.AutoFilterMode = False
End Sub
Sub ResetScroll()
ActiveSheet.ScrollArea = ""
End Sub
Question? Ask it in our Excel Forum
Tutorial: Excel function that makes it easy to extract a word or text from a cell in Excel. This is ...
Tutorial: Excel function that makes combining text very easy. This function is simpler and better th...
Tutorial: In this tutorial I will cover the basic concepts of Formulas and Functions in Excel. A for...
Tutorial: Full explanation of the Vlookup function in Excel, what it is, how to use it, and when yo...
Tutorial: How to create a custom worksheet function in Excel. These are called User Defined Function...
Tutorial: How to prompt a user for their input in Excel. There is a simple way to do this using VBA ...