msgillian
4/17/2019 - 3:37 PM

Excel VBA

Run Sub

It is better to break your code into multiple procedures. We can run one procedure from another.

Here is an example:

Sub Main()
    
    ' call each sub to perform a task
    CopyData
    
    AddFormulas
    
    FormatData

End Sub

Sub CopyData()
    ' Add code here
End Sub

Sub AddFormulas()
    ' Add code here
End Sub

Sub FormatData()
    ' Add code here
End Sub