Page 397 - Excel for Scientists and Engineers: Numerical Methods
P. 397
374 EXCEL: NUMERICAL METHODS
InputBox Method
Displays an input dialog box and waits for user input.
Syntax: object.lnputBox(prornpt, title, defau/t,/eff, top, he/pfi/e, context, type)
Object must be Application. The InputBox method has the additional type
argument that allows the input of a reference. See Microsoft Excel/Visual Basic
Reference or On-Line Help for details.
See also: InputBox Function, MsgBox
Insert Method
Inserts a range of cells in a worksheet.
Syntax: object.lnsert(SHlFT)
Object is a Range object. SHlFT specifies how to SHIFT cells when a range is
inserted in a worksheet (xlToRight or xlDown). Can also use SHlFT = 1 or 2,
respectively. If SHlFT is omitted, the "SHIFT Cells?" dialog box is not
displayed.
Examples: Worksheets("Sheetl2).Range("Al :AlO).lnsert (1) inserts the indicated
range and SHIFTS cells to right.
Worksheets("Sheetl").Columns(4).Insert inserts a new column to the left of column
D.
See also: Delete
lnstr Function
Returns a number specifying the position of the first occurrence of one string
within another. Returns zero if the search string is not found.
Syntax: InStr(starf, string-to-search, string-to-look-for, compare)
Optional start specifies the start position for the search. If omitted, search begins
at position 1. Optional compare determines the type of comparison. See On-Line
Help for details.
Example: InStr(1 ,NameText,"!") finds the first occurrence of the "!I' character within
the string contained in the variable NameText.
Int Function
Rounds a number to an integer.
Syntax: Int(nurnbef)
If number is negative, Int returns the first negative integer less than or equal to
number.
Example: lnt(-2.5) returns -3.
See also: Fix
Integer Data Type
Use to declare a variable's type as Integer, either in a Dim statement, or in a Sub
or Function statement. Two bytes required per variable.
Example: Dim J As Integer
See also: Dim, As, Boolean, Double, String, Variant