SP.gif (807 bytes)

SP.gif (807 bytes) Custom Excel Functions: Hello, World

SP.gif (807 bytes)

SP.gif (807 bytes)

SP.gif (807 bytes)

SP.gif (807 bytes)  
The first exercise you do in any language is to write a function, with no inputs, which returns the string "Hello,  World." This is an immutable tradition of programming. Let us do so!

Enter the following code (how):

Option Explicit
'*********************************************
' HelloWorld: Simplest Possible Program '
'*********************************************
Function
HelloWorld() As String HelloWorld = "Hello Beautiful World!"

End Function

A horizontal bar may appear between the "Option Explicit" line and the "Function..." line.  It's OK if it does.  The text lines in red are comments; they are not necessary but bring good karma.  Hit File/Save, and return to the main Excel window.  If you now enter the formula

=HelloWorld()

into a spreadsheet cell and hit enter, you will be greeted with the results:

Enter Formula: HelloWorldEntering.gif (2232 bytes)
Result: HelloWorldResult.gif (1981 bytes)

Woo hoo!  Now, let's do something a little less trivial.

 

SP.gif (807 bytes)
SP.gif (807 bytes)

 

Move on to Least Squares

SP.gif (807 bytes)
SP.gif (807 bytes) SP.gif (807 bytes) SP.gif (807 bytes)
SP.gif (807 bytes) SP.gif (807 bytes) SP.gif (807 bytes)