That is, they start with a Function statement instead of a Sub statement and end with End Function instead of End Sub. First, they use Function procedures instead of Sub procedures. They differ from macros in two significant ways. Custom functions, like macros, use the Visual Basic for Applications (VBA) programming language.