|
|
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: |
|
| Result: |
|
Woo hoo! Now, let's do something a
little less trivial.
|
|