Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Sub Vs. Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike H. - 26 Sep 2007 11:14 GMT
Would someone please be so kind as to compare and contrast the differences
between a sub and a function.  Thank you.
Chip Pearson - 26 Sep 2007 11:25 GMT
A Function procedure can return a result to the calling procedure, while a
Sub procedure does not return a result:

Sub AAA()
   Dim L As Long
   L = MyFunction(2)
  MsgBox L
End Sub

Function MyFunction (T As Long)
   MyFunction = T * 10
End Function

Signature

Cordially,
Chip Pearson
Microsoft MVP  - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

> Would someone please be so kind as to compare and contrast the differences
> between a sub and a function.  Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.