edit vba excel code example
Example 1: excel vba tool to help with refactoring code
Use Rubberduck:
https://github.com/retailcoder/Rubberduck/wiki/Unit-Testing
Example 2: excel vba Run a Macro every time sheet is changed
'In the VBA code module for that particular worksheet, add this:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
'The name of your Macro or subroutine goes here <--
Application.EnableEvents = True
End Sub