Differences Between Sub Procedure and Functions

Functions Sub Procedures
Functions are a set of reusable code which can be called anywhere in a program as per requirement.
Sub Procedures are also like functions it can also be called anywhere in our program as per requirements.

Functions may or may not return a value .
While sub Procedures does not return a value.

During calling a function Programmer have to use call keyword.

While during calling Sub Procedure there is not requirement of call keyword.

Syntax : 
 function excelvbaport()

 ‘Set of codes 
 }

Syntax : 
 Sub excelvbaport() 
 ‘Set of codes 
 End Sub
Functions are very useful to divide a big program into simple and short program. Similarly Sub Procedures are also divide a long program into short programs.

Learn More About VBA

Introduction to VBA

Comments

Popular posts from this blog

Secure Database Connectivity in node.js with mysql

electron pacakger giving error 'System.AggregateException: One or more errors occurred

node.js web server module