{"id":759,"date":"2018-06-30T17:02:48","date_gmt":"2018-06-30T17:02:48","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=759"},"modified":"2024-02-19T14:55:25","modified_gmt":"2024-02-19T14:55:25","slug":"subroutines-and-functions","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/training\/subroutines-and-functions\/","title":{"rendered":"Subroutines and Functions"},"content":{"rendered":"\n
When you write VBA code you can use a subroutine (sub for short) or a function. The generic name for both is a procedure.<\/p>\n\n\n\n
The basic difference between a function and a subroutine is that the function returns the value and the subroutine doesn\u2019t.<\/p>\n\n\n\n
To better illustrate this to you, let’s create the function and the subroutine that calculate the cube root.<\/p>\n\n\n\n
First, open the VBE by using the Left Alt + F11<\/span><\/strong> keyboard shortcut. Right-click inside the Project Window<\/strong> to insert a new module.<\/p>\n\n\n\n