Difference between Procedure vs Function ?


Ans :


⚝ A) Sub / Procedure :

➀ A sub performs a task but does not return a value.

➁ Subs can be recalled from anywhere in the program and
in multiple types.

➂ Subs cannot be used directly in spreadsheets as formulas.

➃ Users must insert a value in the desired cell before getting the result of the sub.

➄ Excel users can execute a VBA sub.

⚝ B) Function :

➀ A function returns a value of the tasks performed.

➁ Functions are called by a variable.

➂ Functions are used directly in spreadsheets as formulas.

➃ Functions can be used to perform repetitive tasks and return a value.

➄ Excel users cannot execute VBA functions.

Post a Comment

Previous Post Next Post