There are other differences which we will look at but this is the main one. The major difference is that a function can return a value – a sub cannot.
#Sub macro phraseexpress code#
When you create your Sub you can add some code like the following example shows: Sub WriteValues()Ī Function is very similar to a sub.
The end of the Sub is marked by the line End Sub.
9 Custom Function vs Worksheet FunctionĬall a function with params and retrieve value/object.