3. Learn VBA - SUBS and FUNCTIONS explained

Now we're going to learn what VBA SUBS and FUNCTIONS are.
A SUB is a piece of code that runs something
A FUNCTION is a piece of code that returns something
Now lets see it in action with a real life example:
Your wife asks you the time.
You look at your watch
You tell her the time.
What would this look like in code ?
- If we attach the Sub TellWifeTheTime to a button and then press it, what would happen ?
- the Sub TellWifeTheTime goes away and gets the time from the function WhatTimeIsIt, and then displays the time in a message box
Download practise sheet, and press the button
Subs and Functions explained in this training Video:
- Nick's blog
- Add new comment
- 3724 reads

Recent comments
6 hours 57 min ago
6 hours 58 min ago
8 hours 23 min ago
8 hours 34 min ago
8 hours 46 min ago
9 hours 2 min ago
17 hours 37 min ago
19 hours 33 min ago
1 day 12 hours ago
1 day 12 hours ago