Page 396 - Excel for Scientists and Engineers: Numerical Methods
P. 396

APPENDIX  1       SELECTED VISUAL BASIC KEYWORDS                     373



               Excel/Visual Basic Reference, or VBA On-Line Help.
               Example:  Format(TelNumber,"(##)  #t#M#W) formats the value TelNumber in  the
               form of a telephone number.

               Formula Property
               Returns or sets the formula in a cell.
               If  a  cell  contains  a  value,  returns  the  value;  if  the  cell  contains  the  formula,
               returns the formula as a string.
               See also:  Text, Value
               Function Keyword
               Marks the beginning of a Function procedure.
               Syntax: Function name argument?, ...
               Name  is  the  name  of  the  variable  whose  value  is  passed  back  to  the  caller.
               Argument?, etc., are the names assigned to the arguments passed from the caller to
               the procedure.
               Example:  See examples of Function procedures in Chapter 2.
               See also:  Call, Sub
               GoTo Command
               Unconditional branch within a procedure.
               Syntax: GoTo label
               Label  can be a name or a line number.

                If ... Then ... Else ... End If Command
                Delineates a block of conditional statements.
                Syntax: If condition Then ... Else ... End If
               The statement can be all on one line (e.g.,  If condition Then statement).  Alternatively,
                a block If structure can be used, in which case the first line consists of If condition
                Then;  the end of the structure is delineated by End If.  Condition must evaluate to
                True  or  False.  The  ellipsis  following  Then  and  Else  can  represent  a  single
                statement  or  several  statements  separated  by  colons;  these  are  executed  if
                condition is True or False, respectively.
                Examples:     If Char = ".I'  Then GoTo 2000
                              If (Char >= "0 And Char <= "9) Then
                              (statements)
                              End If
                See also:  Elself, End

                InputBox Function
                Displays an input dialog box and waits for user input.
                Syntax: InputBox(prompt, title, defau/t,xpos, ypos, he/pfi/e,context)
                See Microsoft Excel/Visual Basic Reference or On-Line Help for details.
                See also: InputBox Method, MsgBox
   391   392   393   394   395   396   397   398   399   400   401