The way I see it, a sub procedure allows you more interaction with Excel - e.g. you can format* cells in a Sub, not in a Function. A Sub can do copy and pastes, and function cannot.
Additionally, a sub procedure can be made to return values. Once you learn about passing variables by reference or by values (ByRef / ByVal), values changed in a subsequent procedure can be "passed" back to the main sub. For example:
Test2 effectively takes the variable x, doubles it, and "returns" it to Test1. The Debug.Print will show 10.
In fact, you would most likely be playing around with a Sub more than a Function
Added Disclaimer: A function CAN be made to perform actions on Excel - but that just complicates matter.
Bookmarks