What is a VBA function?


A VBA function a function like one that is already in Excel (sum, average, count etc.) which allows you to extend the functionality of Excel.

A function returns a value. So basically you can create your own “sum” function:

Function MySum(arg1, arg2) As Double
    Dim dblTemp As Double
    
    dblTemp = arg1 + arg2
    
    MySum = dblTemp
    
End Function

Let me know if you have any questions