Thread: Sub vs Function
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Sub vs Function

Something that I've always been curious about, but never found a real reason
behind.

Why do we use a Sub instead of using a Function?

Is there any reason other than a Sub returns nothing?

These both do exactly the same thing:

Function Test()
MsgBox "test"
End Function

Sub Test()
MsgBox "test"
End Sub

At the moment my opinion is that Sub is redundant and may as well never be
used.

Thoughts? Comments?


--
Rob van Gelder - http://www.vangelder.co.nz/excel