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
- Login or register to post comments
- 26415 reads
Recent comments
5 years 47 weeks ago
6 years 33 weeks ago
6 years 45 weeks ago
6 years 48 weeks ago
6 years 49 weeks ago
7 years 2 weeks ago
7 years 10 weeks ago
7 years 11 weeks ago
7 years 11 weeks ago
7 years 11 weeks ago