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
- 26317 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago